n = gets.to_i ts = gets.split.map(&:to_i) ds = gets.split.map(&:to_i) puts (1..n).sort_by{|i| Rational(ds[i-1],ts[i-1]) } * " "