#! ruby # yukicoder My Practice # author: Leonardone @ NEETSDKASU def gs(); gets.chomp; end def gi(); gets.to_i; end def gss(); gets.chomp.split; end def gis(); gss.map(&:to_i); end n = gi t = gis d = gis td = (1..n).zip(t,d).sort_by{|(i1,t1,d1)| d1.to_f / t1.to_f } puts td.map{|i1,t1,d1| i1} * " "