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

using namespace std;

int main(){
	while(true){
		int n;
		cin >> n;
		if(n == 0){ break; }
		string str;
		cin >> str;
		while(n--){
			stringstream ss;
			const char *p = str.c_str();
			char n = *(p++);
			int c = 1;
			while(*p != '\0'){
				if(*p != n){ ss << c << n; n = *p; c = 0; }
				c++;
				p++;
			}
			ss << c << n;
			str = ss.str();
		}
		cout << str << endl;
	}
	return 0;
}