#!/usr/bin/env python3

N, K = map(int, input().split())
S = input()
cnt = 0
ans = ""

for i in S:
    if cnt == K-1:
        ans += i.swapcase()
    else:
        ans += i
    cnt += 1

print(ans) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K S = input() S input() input cnt = 0 cnt 0 ans = "" ans "" for i in S:
    if cnt == K-1:
        ans += i.swapcase()
    else:
        ans += i
    cnt += 1 i S if cnt == K-1:
        ans += i.swapcase()
    else:
        ans += i
     cnt == K-1 cnt K-1 K 1 ans += i.swapcase() ans i.swapcase() i.swapcase i swapcase ans += i ans i cnt += 1 cnt 1 print(ans) print ans S = input() input() S cnt = 0 0 cnt ans += i i ans ans = "" "" ans cnt += 1 1 cnt ans += i.swapcase() i.swapcase() ans K = map(int, input().split()) map(int, input().split()) K N, K = map(int, input().split()) map(int, input().split()) N
#!/usr/bin/env python3

N, K = map(int, input().split())
S = input()
cnt = 0
ans = ""

for i in S:
    if cnt == K-1:
        ans += i.swapcase()
    else:
        ans += i
    cnt += 1

print(ans)