#!/usr/bin/env ruby

manhattan = 0
euclidean = 0
l3distance = 0
chebyshev = 0
tempArray = []

loop_number = gets.to_i
vectorA = gets.split.map(&:to_i)
vectorB = gets.split.map(&:to_i)

loop_number.times do |index|
    points = (vectorA[index] - vectorB[index]).abs
    manhattan += points
    euclidean += points ** 2.0
    l3distance += points ** 3.0
    tempArray << points
end

euclidean = euclidean ** (1/2.0)
l3distance = l3distance ** (1/3.0)
chebyshev = tempArray.max
puts manhattan.to_f,euclidean,l3distance,chebyshev.to_f
