import sys
import re
N,K = map(int,input().split())
S = input()

if not ( 1 <= N <= 50 and 1 <= K <= N ): sys.exit()
if len(re.findall(r'[^(A|B|C)]',S)) != 0 : print("NG");sys.exit()

res = []
for I in range(len(list(S))):
    res.append(S[I]) if I + 1 != K else res.append(S[I].lower())
print(''.join(res)) import sys sys import re re N,K = map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K S = input() S input() input if not ( 1 <= N <= 50 and 1 <= K <= N ): sys.exit() not ( 1 <= N <= 50 and 1 <= K <= N ) 1 <= N <= 50 and 1 <= K <= N 1 <= N <= 50 1 <= N 1 N 50 1 <= K <= N 1 <= K 1 K N if len(re.findall(r'[^(A|B|C)]',S)) != 0 : print("NG");sys.exit() len(re.findall(r'[^(A|B|C)]',S)) != 0 len(re.findall(r'[^(A|B|C)]',S)) len re.findall(r'[^(A|B|C)]',S) re.findall re findall r'[^(A|B|C)]' S 0 res = [] res [] for I in range(len(list(S))):
    res.append(S[I]) if I + 1 != K else res.append(S[I].lower()) I range(len(list(S))) range len(list(S)) len list(S) list S res.append(S[I]) if I + 1 != K else res.append(S[I].lower()) I + 1 != K I + 1 I 1 K res.append(S[I]) res.append res append S[I] S I res.append(S[I].lower()) res.append res append S[I].lower() [I].lower [I] S I lower print(''.join(res)) print ''.join(res) ''.join '' join res K = map(int,input().split()) map(int,input().split()) K N,K = map(int,input().split()) map(int,input().split()) N S = input() input() S res = [] [] res
import sys
import re
N,K = map(int,input().split())
S = input()

if not ( 1 <= N <= 50 and 1 <= K <= N ): sys.exit()
if len(re.findall(r'[^(A|B|C)]',S)) != 0 : print("NG");sys.exit()

res = []
for I in range(len(list(S))):
    res.append(S[I]) if I + 1 != K else res.append(S[I].lower())
print(''.join(res))