#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string.h>
#include <sstream>
using namespace std;

template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

int main(){
  int n;
  string str;
  
  while(cin >> n, n){
    cin >> str;
    int list[10];
    while(n--){
      memset(list, 0, sizeof(list));
      
      string tmp="";
      for(int i = 0 ; i < str.size() ; i++){
	list[str[i]-'0']++;
	if(i == str.size()-1 || str[i] != str[i+1]){
	  string t = toString(list[str[i]-'0']);
	  tmp += t + str[i];
	  memset(list, 0, sizeof(list));
	}

      }
      str = tmp;
    }
    cout << str << endl;
  }
  return 0;
}