loop do
  n = gets.to_i
  exit if n == 0

  str = gets.chomp
  n.times do
    p = 0
    res = ""
    count = 1
    until p == str.length do
      char = str[p]
      if (p+1) == str.length || char != str[p+1]
        res += count.to_s
        res += char
        count = 1
      else
        count += 1
      end
      p = p + 1
    end
    str = res
  end
  puts str
end