def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

N, K = MI()
S = input()
T = S.lower()
S = list(S)
T = list(T)

S[K - 1] = T[K - 1]

print("".join(map(str, S))) def INT():
    return int(input()) INT return int(input()) int(input()) int input() input def MI():
    return map(int, input().split()) MI return map(int, input().split()) map(int, input().split()) map int input().split() ().split () input split def LI():
    return list(map(int, input().split())) LI return list(map(int, input().split())) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split N, K = MI() N MI() MI K S = input() S input() input T = S.lower() T S.lower() S.lower S lower S = list(S) S list(S) list S T = list(T) T list(T) list T S[K - 1] = T[K - 1] S[K - 1] S K - 1 K 1 T[K - 1] T K - 1 K 1 print("".join(map(str, S))) print "".join(map(str, S)) "".join "" join map(str, S) map str S def LI():
    return list(map(int, input().split())) def LI():
    return list(map(int, input().split())) LI S = input() input() S def INT():
    return int(input()) def INT():
    return int(input()) INT T = list(T) list(T) T def MI():
    return map(int, input().split()) def MI():
    return map(int, input().split()) MI N, K = MI() MI() N S = list(S) list(S) S K = MI() MI() K T = S.lower() S.lower() T
def INT():
    return int(input())

def MI():
    return map(int, input().split())

def LI():
    return list(map(int, input().split()))

N, K = MI()
S = input()
T = S.lower()
S = list(S)
T = list(T)

S[K - 1] = T[K - 1]

print("".join(map(str, S)))