n = gets.chomp.to_i
x = gets.chomp.split(/\s/).map(&:to_f)
y = gets.chomp.split(/\s/).map(&:to_f)

puts x.zip(y).map {|xi, yi| (xi-yi).abs}.sum
puts Math.sqrt(x.zip(y).map {|xi, yi| (xi-yi).abs ** 2}.sum)
puts Math.cbrt(x.zip(y).map {|xi, yi| (xi-yi).abs ** 3}.sum)
puts x.zip(y).map {|xi, yi| (xi-yi).abs}.max
