import std.stdio, std.string, std.conv, std.algorithm, std.array, std.math, std.range;
void main(){
	auto n = readln.chomp.to!real;
	auto x = readln.split.map!(to!real);
	auto y = readln.split.map!(to!real);
	real a = zip(x,y).map!(s => (s[0]-s[1]).abs).sum;
	real b = zip(x,y).map!(s => (s[0]-s[1]).abs^^2).sum^^(1/2.0);
	real c = zip(x,y).map!(s => (s[0]-s[1]).abs^^3).sum^^(1/3.0);
	real d = zip(x,y).map!(s => (s[0]-s[1]).abs).reduce!(max);
	writefln("%.6f",a);
	writefln("%.6f",b);
	writefln("%.6f",c);
	writefln("%.6f",d);
}