#include <bits/stdc++.h>
using namespace std;

int main(){
    cout << fixed << setprecision(6);
    double x[100],y[100];
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> x[i];
    }
    for(int i=0;i<n;i++){
        cin >> y[i];
    }
    double mn1 =0,mn2 =0,mn3 =0 ,mni =0,a;
    for(int i=0;i<n;i++){
        a = abs(x[i]-y[i]);
        mn1 += a;
        mn2 += a*a;
        mn3 += a*a*a;
        mni = max(mni,a);
    }
    cout << mn1 << endl;
    cout << sqrt(mn2) << endl;
    cout << pow(mn3,1/3.0) << endl;
    cout << mni << endl;
    return 0;
}
