def minc(x, y, n, p)
	if p == Float::INFINITY
		a = []
		xn = x.each
		yn = y.each
		loop do
			a << (xn.next - yn.next).abs
		end
		a.max
	else
		sum = 0.0
		n.times do |i|
			sum += (x[i] - y[i]).abs ** p
		end
		sum ** (1.0 / p)
	end
end

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

puts minc(x, y, n, 1).round(6)
puts minc(x, y, n, 2).round(6)
puts minc(x, y, n, 3).round(6)
puts minc(x, y, n, Float::INFINITY).round(6)