n = gets.to_i
x = gets.split(" ").map(&:to_f)
y = gets.split(" ").map(&:to_f)
z = []
for i in 0..n-1
    d = (x[i]-y[i]).abs
    z = z.push(d)
end
mad = 0
eud_2 = 0
sp_3 = 0
z.each {|distance|
    mad += distance
    eud_2 += distance**2
    sp_3 += distance **3
}

puts mad
puts Math.sqrt(eud_2).round(6)
puts Math.cbrt(sp_3).round(6)
puts z.max