#include <bits/stdc++.h>

using namespace std;

template <typename T> string toString(const T& t) {
    ostringstream os; os << t; return os.str();
}

int main(void) {
    int n;
    string s, ns;
    while (cin >> n, n) {
        cin >> s;

        for (int i = 0; i < n; i++) {
            ns = "";
            for (int j = 0; j < s.size(); ) {
                int k = j;
                while (k < s.size() && s[k] == s[j]) k++;
                ns += toString(k - j) + s[j];
                j = k;
            }
            s = ns;
        }

        cout << s << endl;
    }

    return 0;
}
