#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main(){
    int n,x[1000],y[1000];
    cin >> n;
    for(int i=0;i<n;i++) cin >> x[i];
    for(int i=0;i<n;i++) cin >> y[i];

    double d1,d2,d3,d4;
    for(int i=0;i<n;i++){
        d1 += fabs(x[i]-y[i]);
        d2 += fabs((x[i]-y[i])*(x[i]-y[i]));
        d3 += fabs(pow(x[i]-y[i],3));
        d4 = (d4<fabs(x[i]-y[i]))?fabs(x[i]-y[i]):d4;
        
    }
    
    printf("%f\n%f\n%f\n%f\n",d1,sqrt(d2),pow(d3,1.0/3.0),d4);
}
