#include<iostream>
#include<cstdio>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
int n,t,arr1[105],arr2[105];
double p1,p2,p3,p4;
int main() {
	cin>>n;
	for(int i=0; i<n; i++) {
		cin>>t,arr1[i]=t;
	}
	for(int i=0; i<n; i++) {
		cin>>t,arr2[i]=t;
	}
	for(int i=0; i<n; i++) {
		p1+=abs(arr1[i]-arr2[i]);
		p2+=pow(arr1[i]-arr2[i],2);
		p3+=abs(pow(arr1[i]-arr2[i],3));
		p4=p4>abs(arr1[i]-arr2[i])?p4:abs(arr1[i]-arr2[i]);
	}
	printf("%.6lf\n",p1);
	printf("%.6lf\n",sqrt(p2));
	printf("%.6lf\n",pow(p3,1.0/3));
	printf("%.6lf\n",p4);

}
