n, k = list(map(int,input().split()))

s = eval(input())

ans = ''

for i in range(n):

  if i == k-1:

    ans += s[i].lower()

  else:

    ans += s[i]

print(ans)
_,k=input().split()

s=list(input())

k=int(k)-1

s[k]=s[k].lower()

print(*s,sep='')

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

_, k = input().split()
s = list(input())
k = int(k) - 1
s[k] = s[k].lower()
print(*s, sep="")

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