w=0;1.upto(m=gets.to_i).each{|i|s="";i.times{|j|s+="#{w+=1} "};puts s.chop;e if w==m}