object Main extends App {
    def st(s: String): String = {
        if (s == "") ""
        else {
            val (a, b) = s.span(_ == s(0))
            a.size.toString + a(0) + st(b)
        }
    }
    val in = io.Source.stdin.getLines.map(_.toInt)
    for (n <- in if n != 0) println((1 to n).foldLeft(in.next.toString)((s, _) => st(s)))
}