loop do
  n = gets.to_i
  break if n == 0
  
  str = gets.chomp.split('').map(&:to_i)
  
  n.times do
    str = str.reduce([]){ |arr, i|
      if arr.last(2)[1] == i
        arr[arr.length - 2] += 1
      else
        arr << 1 << i
      end
      
      arr
    }.join('').split('').map(&:to_i)
  end
  
  puts str.join('')
end