import std.stdio, std.string, std.array, std.conv, std.math, std.algorithm;

void main() {
    int n = readln.chomp.to!int;
    double[] x = readln.chomp.split.to!(double[]);
    double[] y = readln.chomp.split.to!(double[]);
    double[] diff = new double[n];
    foreach (i; 0 .. n) diff[i] = abs(x[i] - y[i]);
    double d1 = diff.sum;
    double d2 = sqrt(diff.map!(a => a ^^ 2).sum);
    double d3 = cbrt(diff.map!(a => a ^^ 3).sum);
    double dinf = diff.sort.array[n-1];
    writefln("%0.6f", d1);
    writefln("%0.6f", d2);
    writefln("%0.6f", d3);
    writefln("%0.6f", dinf);
}
