count = gets.to_i;

aryX = gets.split(' ').map(&:to_i);
aryY = gets.split(' ').map(&:to_i);
aryZ = Array.new(count)

for index in 0..count -1 do
	aryZ[index] = (aryX[index].to_i - aryY[index].to_i).abs;
end

sumP1 = 0.to_f;
for indexP1 in 0..count - 1 do
	sumP1 = sumP1 + aryZ[indexP1].to_f;
end

sumP2 = 0.to_f;
for indexP2 in 0..count - 1 do
	sumP2 = sumP2 + aryZ[indexP2] * aryZ[indexP2];
end

sumP3 = 0.to_f;
for indexP3 in 0..count - 1 do
	sumP3 = sumP3 + aryZ[indexP3] * aryZ[indexP3] * aryZ[indexP3];
end

sumPmax = aryZ[0].to_f;
for indexPmax in 0..count - 1 do
	if sumPmax < aryZ[indexPmax] then
		sumPmax = aryZ[indexPmax];
	end
end

puts "%.6f" % sumP1;
puts "%.6f" % Math.sqrt(sumP2);
puts "%.6f" % Math.cbrt(sumP3);
puts "%.6f" % sumPmax;