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

string itos(int x){
  stringstream ss;
  ss << x;
  return ss.str();
}

int main(){
  int n;
  string s;

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

    for(int i = 0; i < n; i++){
      string ns = "";

      for(int j = 0; j < s.length(); j++){
	int cnt = 0;
	for(int k = j; k < s.length() && s[k] == s[j]; k++){
	  cnt++;
	}

	ns += itos(cnt) + s[j];
	j += cnt - 1;
      }

      s = ns;
    }

    cout << s << endl;
  }
}