n,k = map(int,input().split())
s = input()
kb = ''
if k >= 2:
  kb = s[:k-1]
kk = s[k-1]
ka = ''
if k < len(s):
  ka = s[k:]

if kk == 'A':
  print(kb + 'a' + ka)
  exit()
if kk == 'B':
  print(kb + 'b' + ka)
  exit()
if kk == 'C':
  print(kb + 'c' + ka)
  exit()   n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k s = input() s input() input kb = '' kb '' if k >= 2:
  kb = s[:k-1] k >= 2 k 2 kb = s[:k-1] kb s[:k-1] s :k-1 k-1 k 1 kk = s[k-1] kk s[k-1] s k-1 k 1 ka = '' ka '' if k < len(s):
  ka = s[k:] k < len(s) k len(s) len s ka = s[k:] ka s[k:] s k: k if kk == 'A':
  print(kb + 'a' + ka)
  exit() kk == 'A' kk 'A' print(kb + 'a' + ka) print kb + 'a' + ka kb + 'a' kb 'a' ka exit() exit if kk == 'B':
  print(kb + 'b' + ka)
  exit() kk == 'B' kk 'B' print(kb + 'b' + ka) print kb + 'b' + ka kb + 'b' kb 'b' ka exit() exit if kk == 'C':
  print(kb + 'c' + ka)
  exit()   kk == 'C' kk 'C' print(kb + 'c' + ka) print kb + 'c' + ka kb + 'c' kb 'c' ka exit() exit k = map(int,input().split()) map(int,input().split()) k kb = '' '' kb ka = s[k:] s[k:] ka n,k = map(int,input().split()) map(int,input().split()) n kb = s[:k-1] s[:k-1] kb kk = s[k-1] s[k-1] kk ka = '' '' ka s = input() input() s
n,k = map(int,input().split())
s = input()
kb = ''
if k >= 2:
  kb = s[:k-1]
kk = s[k-1]
ka = ''
if k < len(s):
  ka = s[k:]

if kk == 'A':
  print(kb + 'a' + ka)
  exit()
if kk == 'B':
  print(kb + 'b' + ka)
  exit()
if kk == 'C':
  print(kb + 'c' + ka)
  exit()  