while true do
  n = gets.to_i
  break if n == 0

  ss = gets.chomp
  n.times do
    ss = ss.split("").map(&:to_i)
    nss = []
    count = 0
    now = ss.first
    ss.each do |s|
      if s == now
        count += 1
      else
        nss << count << now
        now = s
        count = 1
      end
    end
    nss << count << now
    ss = nss.join
  end

  puts ss
end