import Data.Char

main :: IO()
main = do
    [n, k] <- map read . words <$> getLine
    s <- getLine
    let f = take (k-1) s
    let c = s !! (k-1)
    let lowerc = toLower c
    let cs = [lowerc]
    let b = drop k s
    let o = f ++ cs ++ b
    putStr o