

operation :: String -> String
operation [] = []
operation l@(h:_) = show (length eq) ++ h : operation other
  where
    (eq, other) = span (h == ) l

main :: IO ()
main = do
  n <- fmap (\num -> read num::Int) getLine
  if (n == 0) then return ()
  else
    do
      str <- getLine
      putStrLn $ foldl (\s _ -> operation s) str [1..n]
      main