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

p1 = 0
p2 = 0
p3 = 0
pi = 0
max = 0
for i in 0..n - 1
    tmp = (x[i] - y[i]).abs
    p1 += tmp
    p2 += tmp ** 2
    p3 += tmp ** 3
    
    if max < tmp
        max = tmp
    end
end

puts p1
puts p2 ** (1/2.0)
puts p3 ** (1/3.0)
puts max
