def minkowski_dist(x, y, pn)
	n = x.length
	z = Array.new(n)
	for i in 0..n-1
		z[i] = (x[i] - y[i]).abs()
	end
	case pn
	when 0 
		return z.max
	else 
		return (z.reduce(0.0){|sum, zi| sum += zi**pn}) ** (1/pn.to_f)
	end
end

n = gets.to_i
x = gets.strip.split(" ").map{|i| i.to_f}
y = gets.strip.split(" ").map{|i| i.to_f}

for pn in 1..3
	puts minkowski_dist(x, y, pn)
end
puts minkowski_dist(x, y, 0).floor(5)
