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

s = eval(input())



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

s = list(eval(input()))



s[k-1] = chr(ord(s[k-1])+ord("a")-ord("A"))



print(("".join(s)))
n, k = list(map(int, input().split()))
s = eval(input())
print((s[: k - 1] + chr(ord(s[k - 1]) + 32) + s[k:]))

n, k = list(map(int, input().split()))
s = list(eval(input()))
s[k - 1] = chr(ord(s[k - 1]) + ord("a") - ord("A"))
print(("".join(s)))

-s = eval(input()) -print((s[: k - 1] + chr(ord(s[k - 1]) + 32) + s[k:])) +s = list(eval(input())) +s[k - 1] = chr(ord(s[k - 1]) + ord("a") - ord("A")) +print(("".join(s)))