#include <bits/stdc++.h>
using namespace std;
int n,x[10005],y[100005];
double s[10005],soo;
double av;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&x[i]);
    for(int i=1;i<=n;i++)
        scanf("%d",&y[i]);
    for(int p=1;p<=3;p++)
    {
        double t=0;
        for(int i=1;i<=n;i++)
            t+=pow((double)abs(x[i]-y[i]),(double)p);
        s[p]=pow(t,(double)1/p);
    }
    for(int i=1;i<=n;i++)
        soo=max(soo,(double)abs(x[i]-y[i]));
    for(int i=1;i<=3;i++) printf("%f\n",s[i]);
    printf("%f\n",soo);
}

