import std.stdio;
import std.conv;
import std.string;
import std.range;
import std.algorithm;

void main(){
    while(true){
        int n = readln().chomp().to!int();
        if(n == 0){
            break;
        }
        string str = readln().chomp();
        foreach(i; 0..n){
            string res;
            int count = 1;
            char current = '$';
            foreach(c; str){
                if(current == '$'){
                    current = c;
                }else if(current == c){
                    ++count;
                }else{
                    res ~= text(count, current);
                    current = c;
                    count = 1;
                }
            }
            res ~= text(count, current);
            str = res;
        }
        str.writeln();
    }
}