n = gets.to_i
x = gets.split(" ").map(&:to_f)
y = gets.split(" ").map(&:to_f)

for i in 0..n-1
  x[i] = (x[i] - y[i]).abs
end

puts x.reduce(:+)
puts (x.map {|q| q*q}.reduce(:+))**0.5
puts (x.map {|q| q*q*q}.reduce(:+))**(1.0/3)
puts x.max

