n = gets.to_i a = gets.split b = gets.split aa = a.permutation(n).to_a.zip(b) p aa aaa = aa.map { |i| i } p aaa