#include <iostream>
#include <string>
#include <vector>
using namespace std;

void proc(string& str) {
	string ret;
	char buf[128];
	int size = str.size();
	int s = 0;
	char c1, c2 = -1;
	for(int i=0; i<size; i++) {
		char c1 = str[i];
		if(c1 != c2) {
			if(i-s > 0) { sprintf(buf, "%d%c", i-s, c2); ret += string(buf); }
			c2 = c1;
			s = i;
		}
	}
	if(size-s > 0) { sprintf(buf, "%d%c", size-s, c2); ret += string(buf); }
	
	str = ret;
}

int main() {
	int n;
	string str;
	
	while( 1 ) {
		cin >> n;
		if(n == 0) break;
		cin >> str;
		for(int i=0; i<n; i++) {
			proc(str);
		}
		cout << str << endl;
	}
}