include Math

def dist(x, y, p)
    if p == "inf"
        return chebyshev(x, y)
    else
        dist = 0
        x.zip(y) do |xi, yi|
            dist += (xi - yi).abs ** p
        end
        return dist ** (1.0 / p)
    end
end

def chebyshev(x, y)
    dist = -1
    x.zip(y) do |xi, yi|
        dist = [dist, (xi - yi).abs].max
    end
    return dist
end

dim = gets.chomp.to_i

x = gets.chomp.split.map(&:to_i)
y = gets.chomp.split.map(&:to_i)

for i in 1..3
    puts dist(x, y, i)
end
puts dist(x, y, "inf")