#!/usr/bin/env ruby

if __FILE__ == $0 then
	n = gets.chomp.to_i
	X = gets.split.map(&:to_i)
	Y = gets.split.map(&:to_i)

	dist = []
	n.times do |i|
		dist += [(X[i]-Y[i]).abs]
	end

	p dist.sum
	p dist.map { |x| x**2 }.sum ** (1.0/2)
	p dist.map { |x| x**3 }.sum ** (1.0/3)
	p dist.max
end

