import Data.Char


main::IO()
main=do
  (n:k:_)<-return.map read.words=<<getLine
  str<-getLine
  putStr ((solver str k)++"\n")

solver::String->Int->String
solver str k = [if i == k then toLower c else c |(c,i)<-zip str [1..]]
