#encoding:utf-8 No.0506 2014.11.15
def change_str(str_in)
  str_out = ""
  length = 1
  i = 0
  while str_in[i]
    if str_in[i] == str_in[i+1]
      length += 1
    else
      str_out << length.to_s + str_in[i]
      length = 1
    end
    i += 1
  end
  return str_out
end

while (n = gets.chomp.to_i) != 0
  str = gets.chomp
  n.times do
    str = change_str(str)
  end
  puts str
end