include Math

def manhattan(x, y)
    dist = 0
    x.zip(y) do |xi, yi|
        dist += (xi  - yi).abs
    end
    return dist
end

def euclid(x, y)
    dist = 0
    x.zip(y) do |xi, yi|
        dist += (xi - yi) ** 2
    end
    return sqrt(dist)
end

def p3(x, y)
    dist = 0
    x.zip(y) do |xi, yi|
        dist += (xi - yi).abs ** 3
    end
    return cbrt(dist)
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)

puts manhattan(x, y)
puts euclid(x, y)
puts p3(x, y)
puts chebyshev(x, y)