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

manhattan = 0.0
loop.times{|i|
    manhattan += (x[i] - y[i]).abs
}

euclid = 0.0
loop.times{|i|
    euclid += (x[i] - y[i]).abs ** 2
}

p3 = 0.0
loop.times{|i|
    p3 += (x[i] - y[i]).abs ** 3
}

chebyshev = x[0] - y[0]
loop.times{|i|
    chebyshev = [chebyshev, (x[i] - y[i])].max
}

puts manhattan
puts euclid ** (1.0/2.0)
puts p3 ** (1.0/3.0)
puts chebyshev

