import Data.List (sort)
import Data.Char (toLower)

readIntLine :: IO ([Int])
readIntLine = do
    x <- getLine
    return $ map (read :: String -> Int) $ words x

main :: IO ()
main = do
    [n,k] <- readIntLine
    s <- getLine
    putStrLn $ lowered s k

lowered :: String -> Int -> String
lowered s k =
    let p1 = take (k-1) s
        p2 = toLower $ head $ drop (k-1) s
        p3 = drop k s
      in p1 ++ [p2] ++ p3
