#!/usr/bin/env ruby

n = gets.to_i
x = gets.split(" ").map{|i| i.to_i}
y = gets.split(" ").map{|i| i.to_i}

div = Array.new(n)
sigma = 0

for i in 0..(n - 1)
  div[i] = (x[i] - y[i]).abs
end

puts div.inject(:+)

for i in 0..(n - 1)
  sigma += div[i] ** 2
end

puts Math::sqrt(sigma)

sigma = 0

for i in 0..(n - 1)
  sigma += div[i] ** 3
end

puts sigma ** (1.0 / 3.0)
puts div.max