import Control.Applicative
import Data.Char

main = do
  [n, k] <- map (read::String -> Int) . words <$> getLine
  s <- getLine
  let new_s = map (\i-> if i == k - 1 then (toLower $ s !! i)  else (s !! i)) [0..(n - 1)]
  putStrLn $ new_s