#include<iostream>
#include<string>
#include<cmath>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

string itos(int num){
	int cnt=0;
	while(num/(int)pow(10,cnt)){
		cnt++;
	}
	string ans="";
	for(int i=cnt-1;i>=0;i--){
		ans+=(char)(num/(int)pow(10,i)+48);
		num-=(num/(int)pow(10,i))*pow(10,i);
	}
	return ans;
}

int main(){
	int n;
	while(1){
		cin>>n;
		if(!n)break;
		string s;
		cin>>s;
		int size=s.size();
		int count=0;
		string ans="";
		rep(i,n){
			count=0;
			while(count<size){
				char check=s[count];
				int cnt=0;
				while(s[++count]==check){
					cnt++;
				}
				cnt++;
				ans+=itos(cnt);
				ans+=check;
			}
			s=ans;
			size=s.size();
			ans="";
		}
		cout<<s<<endl;
	}
	return 0;
}