import std.stdio;
import std.string;
import std.conv;

void main(){
    int n;
    while((n = readln.chomp.to!int) != 0){
        string input = readln.chomp;
        foreach(Unused; 0..n){
            input = input.operate;
        }
        input.writeln;
    }
}

string operate(string input){
    string res;
    char current = input[0];
    int count = 1;
    foreach(c; input[1..$]){
        if(current == c){
            ++count;
        }else{
            res ~= text(count, current);
            current = c;
            count = 1;
        }
    }
    res ~= text(count, current);
    return res;
}