n = gets(chomp:true).to_i
x = gets.split.map(&:to_i)
y = gets.split.map(&:to_i)
d, p1, p2, p3, p4 = 0.0, 0.0, 0.0, 0.0, 0.0

n.times do |n_n|
  d = (x[n_n] - y[n_n]).abs
  p1 += d
  p2 += d * d
  p3 += d * d * d
  p4 = d if d > p4
end

puts p1.round(6)
puts Math.sqrt(p2).round(6)
puts (p3 ** (1/3r)).round(6)
puts p4.round(6)
