n ,k = map(int, input().split())
s = input()
ret = ""
for i in range(n):
    if i==k-1:
        if s[k-1]=="A":
            ret += "a"
        elif s[k-1]=="B":
            ret += "b"
        elif s[k-1]=="C":
            ret += "c"
    else:
        ret += s[i]
print(ret) n ,k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k s = input() s input() input ret = "" ret "" for i in range(n):
    if i==k-1:
        if s[k-1]=="A":
            ret += "a"
        elif s[k-1]=="B":
            ret += "b"
        elif s[k-1]=="C":
            ret += "c"
    else:
        ret += s[i] i range(n) range n if i==k-1:
        if s[k-1]=="A":
            ret += "a"
        elif s[k-1]=="B":
            ret += "b"
        elif s[k-1]=="C":
            ret += "c"
    else:
        ret += s[i] i==k-1 i k-1 k 1 if s[k-1]=="A":
            ret += "a"
        elif s[k-1]=="B":
            ret += "b"
        elif s[k-1]=="C":
            ret += "c"
     s[k-1]=="A" s[k-1] s k-1 k 1 "A" ret += "a" ret "a" elif s[k-1]=="B":
            ret += "b"
         s[k-1]=="B" s[k-1] s k-1 k 1 "B" ret += "b" ret "b" elif s[k-1]=="C":
            ret += "c"
     s[k-1]=="C" s[k-1] s k-1 k 1 "C" ret += "c" ret "c" ret += s[i] ret s[i] s i print(ret) print ret ret += "b" "b" ret s = input() input() s k = map(int, input().split()) map(int, input().split()) k n ,k = map(int, input().split()) map(int, input().split()) n ret += "a" "a" ret ret = "" "" ret ret += s[i] s[i] ret ret += "c" "c" ret
n ,k = map(int, input().split())
s = input()
ret = ""
for i in range(n):
    if i==k-1:
        if s[k-1]=="A":
            ret += "a"
        elif s[k-1]=="B":
            ret += "b"
        elif s[k-1]=="C":
            ret += "c"
    else:
        ret += s[i]
print(ret)