def getDistance( x, y, n, pow )
	dxy = 0
	for i in ( 0 .. n )
		dxy += ( x[i].to_f - y[i].to_f ).abs**pow
	end
	return dxy**(1/pow.to_f)
end
		

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

puts( getDistance( x, y, n, 1 ) )
puts( getDistance( x, y, n, 2 ) )
puts( getDistance( x, y, n, 3 ) )
dxy = []
for i in ( 0 .. n )
	dxy[i] = ( x[i].to_f - y[i].to_f ).abs
end
puts( dxy.max )