program cc
  implicit none
  integer :: n,k
  character :: s*128,ans*128,instead*1
  read *, n, k
  read *, s
  if (s(k:k) == "A") then
    instead = "a"
  else if (s(k:k) == "B") then
    instead = "b"
  else if (s(k:k) == "C") then
    instead = "c"
  end if

  if (k == 1) then
    ans = instead//s(2:n)
  else if (k == n) then
    ans = s(1:n-1)//instead
  else
    ans = s(1:k-1)//instead//s(k+1:n)
  end if
  print '(a)', ans
  stop
end program cc
