import Control.Monad (unless)
import Data.List

main = do
  n <- readLn
  unless (n == 0) $ do
    str <- getLine
    putStrLn.foldl1 (.) (replicate n countStr) $ str
    main

countStr = concat.map count.group
  where count cs = (show.length $ cs) ++ [head cs]