include Math
n = gets.chomp.to_i
x = gets.chomp.split(' ').map(&:to_f)
y = gets.chomp.split(' ').map(&:to_f)
z = []
x.zip(y) do |ary| 
  z << ary.inject(:-).abs
end
# d1
puts z.inject(:+)
# d2
sum = z.inject(0.0) {|res, i| res + i**2}
puts sqrt(sum)
# d3
sum = z.inject(0.0) {|res, i| res + i**3}
puts sum ** (1.0/3)
# d inf
puts z.max