N=gets.to_i A=[0]+gets.split.map(&:to_i) puts (1..N).map{|i| t=[j=i] t<