
import std.stdio;
import std.conv;
import std.string;

void main() {
  int times;
  while((times = readln.chomp.to!(int)) != 0){
    char[] str = cast(char[])readln.chomp;
    for(int i = 0; i < times; i++) {
      char[] next_str;
      char prev;
      uint n = 1;
      prev = str[0];
      foreach(s; str[1..$]) {
        if (prev == s) ++n;
        else {
          next_str ~= text(n, prev);
          prev = s;
          n = 1;
        }
      }
      next_str ~= text(n, prev);
      str = next_str;
    }
    writeln(str);
  }
}