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

int main() {
	int N;
	double x[100], y[100], dis[100], sum = 0;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> x[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> y[i];
		dis[i] = abs(x[i] - y[i]);
	}
	for (int i = 1; i <= 3; i++) {
		for (int j = 0; j < N; j++) {
			sum += pow(dis[j], i);
		}
		printf("%.8f\n", pow(sum, 1.0 / i));
		sum = 0;
	}
	for (int i = 0; i < N; i++) {
		sum = max(sum, dis[i]);
	}
	printf("%.8f\n", sum);
}
