include Math
n = gets.to_i
x = gets.split(" ").map(&:to_i)
y = gets.split(" ").map(&:to_i)

_Dxy1 = 0
_Dxy2 = 0
_Dxy3 = 0
_Dxyi = (x[0]-y[0]).abs
0.upto(n-1){|i|
  d = (x[i]-y[i]).abs
  _Dxy1 += d
  _Dxy2 += d**2
  _Dxy3 += d**3
  _Dxyi = d if (_Dxyi < d)
}

printf "%f\n", _Dxy1
printf "%f\n", sqrt(_Dxy2)
printf "%f\n", _Dxy3**(1.0/3.0)
printf "%f\n", _Dxyi