#include <iostream>
#include <string>
using namespace std;

int main(){
    string in;
    int n;
    while(cin >> n >> in){
        if(n == 0) break;
        string nstr = "";
        int count = 1;
        for(int j = 0;j<n;j++){
            nstr = "";
            count = 1;
        for(int i = 1;i<in.length();i++){
            if(in[i-1] != in[i]){
                nstr += to_string(count) + in[i-1];
                count = 1;
            }
            else{
                count++;
            }
            // cout << nstr << endl;
        }
        nstr += to_string(count) + in[in.length()-1];
        in = nstr;
        }
        cout << in << endl;
    }
}