N = gets.to_i
x = gets.split.map(&:to_i)
y = gets.split.map(&:to_i)
arr = []
N.times do |n|
  arr.push((x[n] - y[n]).abs)
end
puts arr.sum
puts Math.sqrt(arr.map {|a| a ** 2}.sum)
puts Math.cbrt(arr.map {|a| a ** 3}.sum)
puts arr.max
