n = gets.to_i
x = gets.chomp.split(" ").map(&:to_f)
y = gets.chomp.split(" ").map(&:to_f)
# Minkowski distance
(1..3).each do |i|
  sum = 0.0
  n.times do |j|
    sum += (x[j] - y[j]).abs**i
  end
  puts (sum ** (1 / i.to_f)).round(6)
end

# Chebyshev distance
d = []
n.times do |i|
  d.push (x[i] - y[i]).abs
end
puts d.max