import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Data.Char

main :: IO ()
main = readLine >>= main'
    where
        main' [n, k] = getLine >>= putStrLn . solve n k

solve :: Int -> Int -> String -> String
solve n k = map mf . zip [1..]
    where
        mf (i, c)
            | i == k = toLower c
            | otherwise = c
            

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine