### main

loop do
  n = gets.strip.to_i
  break if n == 0

  str = gets.strip
  if str.empty?
    puts ''
    next
  end

  n.times do
    ds = str.split('')
    d0 = ds.shift
    k = 1
    str0 = ''

    while ! ds.empty?
      d = ds.shift

      if d != d0
        str0 += k.to_s + d0.to_s
        d0 = d
        k = 1
      else
        k += 1
      end
    end

    str = str0 + k.to_s + d0.to_s
  end

  puts str
end