#include <bits/stdc++.h>
using namespace std;

string ItoS(int a){
  string res;
  if(a == 0) return "0";
  while(a) res = char(a%10+'0')+res,a/=10; 
  return res;
}

int main(){
  while(1){
  int n;
  string str;
  cin>>n;
  if(n==0)break;
  cin>>str;

  while(n--){
    str+='#';
    string nstr;
    int cnt = 1;
    char pre = str[0];
    for(int j=1;j<(int)str.size();j++){
      if(str[j]!=pre) nstr+=ItoS(cnt)+pre,cnt=0;
      cnt++;
      pre = str[j];
    }
    str = nstr;
  }
  cout<<str<<endl;
  }

  return 0;
}