import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy.Builder as BLB
import Data.List
import Data.Char

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


solve :: Int -> Int -> String -> String
solve _ _ [] = []
solve k i (c:cs)
  | k == i = toLower c : cs
  | otherwise = c:(solve k (i+1) cs)