n = gets.to_i
xs = gets.split.map(&:to_i)
ys = gets.split.map(&:to_i)

p1 = 0
p2 = 0
p3 = 0
p_inf = 0

n.times do |i|
  diff = (xs[i] - ys[i]).abs

  p1 += diff
  p2 += diff**2
  p3 += diff**3
  p_inf = [p_inf, diff].max
end

p2 = Math.sqrt(p2)
p3 = Math.cbrt(p3)

p p1, p2, p3, p_inf

