#include <stdio.h>
#include <vector>
#include <string.h>
#include <string>
#include <stdlib.h>
#include <cstring>

using namespace std;

int main(){
  while(1){
    int n;
    char t[256];
    scanf("%d %s", &n, t);

    if (n==0) break;

    string s(t);

    int count;
    char buf, tmp[256];

    for(int i=0;i<n;i++){
      int l = s.length();
      string str;
      count=0;

      for(int j=0;j<l;j++){
        if(j==0 || s[j] == buf){
          count++;
        }else{
          sprintf(tmp, "%d", count*10+(buf-'0'));
          str += string(tmp);
          count = 1;
        }
        buf=s[j];
      }
      sprintf(tmp, "%d", count*10+(buf-'0'));
      str+=string(tmp);
      s = str;
    }

    printf("%s\n", s.c_str());
  }
}