N = gets.to_i
A = gets.split.map { |e|e.to_i  }
B = gets.split.map { |e|e.to_i  }

manhattan = 0.0
euclidian = 0.0
l3  = 0.0
chebyshev = 0.0
N.times do |i|
  diff = (A[i]-B[i]).abs
  manhattan += diff
  euclidian += (diff)**2
  l3 += diff**3
  chebyshev = diff if chebyshev < diff
end

puts manhattan,Math.sqrt(euclidian),(l3**(1/3.0)),chebyshev