def getDistance( x, y, n, pow )
	dxy = 0
	for i in ( 0 ... n )
		dxy += ( x[i] - y[i] ).abs**pow
	end
	return dxy**(1.0/pow)
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 = Array.new( n, 0 )
for i in ( 0 ... n )
	dxy[i] = ( x[i] - y[i] ).abs
end
puts( dxy.max )