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

int x[110];
int y[110];
int diff[110];
double d[4];

int main(){
	int n;
	scanf("%d", &n);
	for(int i = 0; i < n; i++)
		scanf("%d", x+i);
	for(int i = 0; i < n; i++)
		scanf("%d", y+i);
	for(int i = 0; i < n; i++)
		diff[i] = abs(x[i] - y[i]);
	for(int i = 0; i < n; i++) {
		d[0] += diff[i];
		d[1] += pow(diff[i], 2);
		d[2] += pow(diff[i], 3);
		d[3] = max(d[3], (double)diff[i]);
	}
	d[1] = sqrt(d[1]);
	d[2] = cbrt(d[2]);
	for(int i = 0; i < 4; i++)
		printf("%.12lf\n", d[i]);
}

