#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); (i)++)
using namespace std;
typedef long long ll;

int main() {
    int n, x[100], y[100];
    cin >> n;
    rep(i,n) cin >> x[i];
    rep(i,n) cin >> y[i];

    double d[4] = {};

    for (int p = 1; p <= 3; p++) {
        rep(i,n) {
            d[p] += pow(abs(x[i] - y[i]), p);
        }
        d[p] = pow(d[p], 1.0/p);
    }

    rep(i,n) {
        d[0] = (d[0] < abs(x[i] - y[i]) ? abs(x[i] - y[i]) : d[0]);
    }

    printf("%lf\n%lf\n%lf\n%lf\n", d[1], d[2], d[3], d[0]);
}
