n = gets.chomp.to_i
x = gets.chomp.split(" ").map{|z| z.to_i}
y = gets.chomp.split(" ").map{|z| z.to_i}

d = []
for i in 1..n do
  d[i-1] = (x[i-1] - y[i-1]).abs
end

for p in 1..3 do
  printf("%f\n",(d.map{|z| z**p}.inject(:+))**(1.0/p))
end

printf("%f\n",d.max)
