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

string runLength(string s) {
	int cnt = 0;
	char num;
	string ans;
	num = s[0];
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == num) {
			cnt++;
		} else {
			ans += to_string(cnt) + num;
			cnt = 1;
			num = s[i];
		}
	}
	ans += to_string(cnt) + num;
	

	return ans;
}

int main() {
	int i, j, n;
	
	while (1) {
		cin >> n;
		if (n == 0)break;
		string s;
		cin >> s;

		for (i = 0; i < n; i++) {
			s = runLength(s);
		}

		cout << s << endl;
	}






	return 0;
}