import std.stdio, std.string, std.math, std.conv, std.algorithm;
void main() {
	readln;
	int[][] d;
	foreach (string l; lines(stdin))
		d ~= l.split.to!(int[]);
	int n = d[0].count.to!int;
	foreach (p; 1..4) {
		auto s = 0.0f;
		foreach (i; 0..n)
			s += pow(abs(d[0][i] - d[1][i]), p);
		s = pow(s, 1.0f/p.to!float);
		"%.6f".writefln(s);
	}
	float[] m;
	foreach (i; 0..n)
		m ~= abs(d[0][i] - d[1][i]).to!float;
	"%.6f".writefln(m.sort!("a>b")[0]);
}
