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

void main() {
  int times = readln.chomp.to!(int);
  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 ~= [cast(char)(n + '0'), prev];
        prev = s;
        n = 1;
      }
    }
    next_str ~= [cast(char)(n + '0'), prev];
    str = next_str;
  }
  writeln(str);
}