n = gets.to_i
a = readline.split.map(&:to_i)
b = readline.split.map(&:to_i)
c = a.zip(b).map { |a, b| a - b }.map(&:abs)

def distance(c, q)
  d = c.inject(0.0) do |sum, v|
    sum += (v ** q).abs
  end

  case q
  when 1
    d
  when 2
    Math.sqrt(d)
  when 3
    Math.cbrt(d)
  end
end
puts distance(c, 1)
puts distance(c, 2)
puts distance(c, 3)
puts c.max