#include <iostream>
#include <sstream>

using namespace std;

string change(const string &s)
{
    string ret;
    stringstream ss;

    for (int i = 0; i < s.size(); i++) {
        int num = 1;
        char ch = s[i++];

        while (i < s.size() && ch == s[i]) {
            num++;
            i++;
        }
        i--;

        ss << num;
        ret += ss.str();
        ss.str("");
        ret += (char)(ch);
    }

    return ret;
}

int main()
{
    int n;

    while (cin >> n, n) {
        string s;

        cin >> s;

        for (int i = 0; i < n; i++)
            s = change(s);

        cout << s << endl;
    }

    return 0;
}