def read_vector
  gets.split(" ").map(&:to_f)
end

def minkowski(x, y, p)
  (x.zip(y).map {|a| (a.first - a.last).abs ** p}.reduce(:+)) ** (1 / p.to_f)
end

def chebyshev(x, y)
  x.zip(y).map {|a| (a.first - a.last).abs}.max
end

n = gets.to_i
x = read_vector
y = read_vector
puts "%.6f"%minkowski(x, y, 1)
puts "%.6f"%minkowski(x, y, 2)
puts "%.6f"%minkowski(x, y, 3)
puts "%.6f"%chebyshev(x, y)