# coding: utf-8

lines = $stdin.read

array = lines.split("\n")

n = array[0].to_i
x = array[1].split(" ")
y = array[2].split(" ")

# p = 1
d = 0
for i in 0..(n-1)
  d += (x[i].to_f - y[i].to_f).abs
end

printf "%f\n",d

# p = 2
d = 0
for i in 0..(n-1)
  d += (x[i].to_f - y[i].to_f).abs ** 2
end

printf "%f\n", Math.sqrt(d)

# p = 3
d = 0
for i in 0..(n-1)
  d += (x[i].to_f - y[i].to_f).abs ** 3
end
printf "%f\n", d**(1/3.0)

# p = ???
d = []
for i in 0..(n-1)
  d.push (x[i].to_f - y[i].to_f).abs
end
printf "%f\n", d.max