# your code goes here gets line = gets.split(' ').map(&:to_i) 8.downto(0) do |i| line[i].times do print i + 1 end end