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