#include <iostream>
#include <sstream>
#include <string>

using namespace std;

int main() {
  for (;;) {
    int n;
    cin >> n;
    if (!n) return 0;
    string result;
    cin >> result;
    result.push_back(0);
    for (int i = 0; i < n; i++) {
      stringstream s;
      for (int i = 1, length = 1; i < result.size()+1; i++)
        if (result[i] == result[i-1])
          length++;
        else {
          s << length << result[i-1];
          length = 1;
        }
      result = s.str();
    }
    cout << result << endl;
  }
}