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

string str, tmp;
char ch;
int pos;
void opr(int d=0) {
	if (d==0) {
		ch = str[pos];
	} else if (str[pos]=='\0' || str[pos]!=ch) {
		int nums[3] = { 0, 0, 0};
		int i;
		for (i=0; i<3; i++) {
			nums[i] = d % 10;
			d /= 10;
			if (d==0) break;
		}
		char ds[2] = { '0', '\0' };
		while (i>=0) {
			ds[0] = (char) ((int) '0' + nums[i]);
			tmp += ds;
			i--;
		}
		ds[0] = ch;
		tmp += ds;
		if (str[pos] == '\0') return;
		else {
			ch = str[pos];
			d = 0;
		}
	}
	pos++;
	return opr(d+1);
}

int main() {
	int N;
	while (cin >> N, N) {
		cin >> str;
		
		while (N--) {
			pos = 0;
			tmp = "";
			opr();
			str = tmp;
		}

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