MODE = "stdio"
require 'matrix'
include Math
line = Array.new

if(defined? MODE)
  line = STDIN.read.split("\n")
else
  tmp = '3
  1 2 3
  2 0 4'.split("\n")
  tmp.each{|s|
    line << s.strip
  }
end
 n = line[0].to_i
 

x = line[1].split(" ").map(&:to_i)
y = line[2].split(" ").map(&:to_i)

xy = x.zip(y).map{|x,y| (x-y).abs.to_f}
p2 = xy.map{|xy| xy**2}.inject(&:+)
p3 = xy.map{|xy| xy**3}.inject(&:+)

p1 = xy.inject(&:+)
p2 = p2**(1.0/2)
p3 = p3**(1.0/3)
pinf = xy.max

printf("%.10f\n%.10f\n%.10f\n%.10f\n",p1,p2,p3,pinf)