import std.stdio;
import std.string;
import std.algorithm;
import std.conv;
import std.range;
import std.math;

void main() {
    int n = readln.chomp.to!int;
    auto x = readln.chomp.split.map!(to!double).array;
    auto y = readln.chomp.split.map!(to!double).array;

    foreach (e; [ 1, 2, 3, double.infinity]) {
        writefln("%06f", mindis(x, y, n, e));
    }
}

double mindis(double[] x, double[] y, int len, double exp) {
    if (exp == double.infinity) {
        double[] res = new double[x.length];
        res[] = x[] - y[];
        return res.map!(abs).reduce!(max);
    } else {
        double res = 0;
        for (int i = 0; i < len; i++) {
            res += pow(abs(x[i] - y[i]), exp);
        }
        return pow(res, 1 / exp);
    }
}