n = gets.chomp.to_i
x = gets.split.map(&:to_i)
y = gets.split.map(&:to_i)

sum1 = 0
n.times do |i|
  if x[i] < y[i]
    sum1 = sum1 + y[i] - x[i]
  else sum1 = sum1 + x[i] - y[i]
  end
end
puts sum1

sum2 = 0
n.times do |j|
  sum2 = sum2 + ((x[j] - y[j])**2)
end
puts sum2 ** 0.5

sum3 = 0
n.times do |k|
  if x[k] < y[k]
    sum3 = sum3 + ((y[k] - x[k])**3)
  else sum3 = sum3 + ((x[k] - y[k])**3)
  end
end
puts sum3 ** (1/3.0)

max = 0
n.times do |l|
  if x[l] < y[l]
    len = y[l] - x[l]
  else len = x[l] - y[l]
  end

  if len > max
    max = len
  end
end
puts max