n = gets.to_i
x = gets.split.map(&:to_f)
y = gets.split.map(&:to_f)
p1, p2, p3 = 0, 0, 0;
max_array = []
n.times do |i|
  q = x[i] - y[i]
  q = q * -1 if q < 0
  max_array << q
  p1 += q
  p2 += q ** 2
  p3 += q ** 3
  puts "??????#{p3}"
end
puts p1
puts Math.sqrt(p2)
puts p3 ** Rational(1, 3)
puts max_array.max