import Data.Char

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

func :: Int -> String -> String
func _ [] = []
func 0 (x:xs) = toLower x : func (0 - 1) xs
func n (x:xs) = x : func (n - 1) xs