import Data.Char

solve :: String -> Int -> Int -> String
solve (s:sx) pos counter
  | pos == counter = (toLower s):sx
  | otherwise = s : solve sx pos (counter + 1)

main :: IO ()
main = do
  [n, k] <- map read . words <$> getLine :: IO [Int]
  s <- getLine :: IO String
  putStrLn $ solve s k 1