#include<iostream>
#include<cmath>
using namespace std;
#define F(i,s,e) for(int i=s;i<e;++i)

int main(){
    int n;
    cin >> n;
    int x[n],y[n];
    F(i,0,n) cin >> x[i];
    F(i,0,n) cin >> y[i];
    double d1=0,d2=0,d3=0,di=0;
    F(i,0,n){
        double d=abs(x[i]-y[i]);
        d1+=d;
        d2+=d*d;
        d3+=d*d*d;
        if(di<=d) di=d;
    }
    d2=sqrt(d2);
    d3=cbrt(d3);
    printf("%.10f\n%.10f\n%.10f\n%.10f\n",d1,d2,d3,di);
    return 0;
}
