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

s = eval(input())

print((s[:k-1]+s[k-1].lower()+s[k:]))
n,k = list(map(int,input().split()))

s = list(eval(input()))



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

print((''.join(s)))
n, k = list(map(int, input().split()))
s = eval(input())
print((s[: k - 1] + s[k - 1].lower() + s[k:]))

n, k = list(map(int, input().split()))
s = list(eval(input()))
s[k - 1] = s[k - 1].lower()
print(("".join(s)))

-s = eval(input()) -print((s[: k - 1] + s[k - 1].lower() + s[k:])) +s = list(eval(input())) +s[k - 1] = s[k - 1].lower() +print(("".join(s)))