n = gets.to_i
x = []
x[0] = gets.split.map(&:to_i)
x[1] = gets.split.map(&:to_i)
puts x.transpose.map{|f,s|(f-s).abs}.inject(:+)
puts Math.sqrt(x.transpose.map{|f,s|(f-s)**2}.inject(:+))
puts Math.cbrt(x.transpose.map{|f,s|(f-s).abs**3}.inject(:+))
puts x.transpose.map{|f,s|(f-s).abs}.max