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

p1, p2, p3, pmax = 0,0,0,0

(0...n).each do |i|
  p1 += (x[i] - y[i]).abs
  p2 += ((x[i] - y[i]).abs)**2
  p3 += ((x[i] - y[i]).abs)**3
  pmax = ((x[i] - y[i]).abs) if pmax < ((x[i] - y[i]).abs)

  i += 1
end

puts p1
puts p2**(1/2.0)
puts p3**(1/3.0)
puts pmax