# coding: utf-8

# Your code here!



# ABC126A

from copy import deepcopy

N, K = list(map(int, input().split()))

S = eval(input())



l = [s for s in S]

l[K-1] = l[K-1].lower()

print((''.join(l)))
n, k = list(map(int, input().split()))

s = eval(input())



ans = ""

for i in range(len(s)):

  if i == k-1:

    ans += s[i].lower()

  else:

    ans += s[i]



print(ans)

# coding: utf-8
# Your code here!
# ABC126A
from copy import deepcopy

N, K = list(map(int, input().split()))
S = eval(input())
l = [s for s in S]
l[K - 1] = l[K - 1].lower()
print(("".join(l)))

n, k = list(map(int, input().split()))
s = eval(input())
ans = ""
for i in range(len(s)):
    if i == k - 1:
        ans += s[i].lower()
    else:
        ans += s[i]
print(ans)

-# coding: utf-8 -# Your code here! -# ABC126A -from copy import deepcopy - -N, K = list(map(int, input().split())) -S = eval(input()) -l = [s for s in S] -l[K - 1] = l[K - 1].lower() -print(("".join(l))) +n, k = list(map(int, input().split())) +s = eval(input()) +ans = "" +for i in range(len(s)): +    if i == k - 1: +        ans += s[i].lower() +    else: +        ans += s[i] +print(ans)