def manhattan(n, x_v, y_v)
  d = 0.0
  for i in 0..n.to_i-1 do
    d += (x_v[i].to_f - y_v[i].to_f).abs
  end
  d
end

def euc_i(n, x_v, y_v, p)
  d = 0.0
  for i in 0..n.to_i-1 do
    d += (x_v[i].to_f - y_v[i].to_f).abs ** p
  end
  d = d ** (1/p.to_f)
end

def chebshef(n, x_v, y_v)
  d = 0.0
  for i in 0..n.to_i-1 do
    c = (x_v[i].to_f - y_v[i].to_f).abs
    d > c ? d = d : d = c
  end
  d
end

n = STDIN.gets
x = STDIN.gets
y = STDIN.gets

if n.to_i < 1 and n.to_i > 100
   exit
end

x_v = x.split
y_v = y.split

puts sprintf("%.6f", manhattan(n, x_v, y_v))
puts sprintf("%.6f", euc_i(n, x_v, y_v, 2))
puts sprintf("%.6f", euc_i(n, x_v, y_v, 3))
puts sprintf("%.6f", chebshef(n, x_v, y_v))