#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  
  vector<int> xs(n);
  vector<int> ys(n);

  for (int i = 0; i < n; i++) cin >> xs.at(i);
  for (int i = 0; i < n; i++) cin >> ys.at(i);

  double sum1 = 0.0, sum2 = 0.0, sum3 = 0.0, maxd = 0.0;

  for (int i = 0; i < n; i++) {
    double d = abs(xs.at(i) - ys.at(i));
    sum1 += d;
    sum2 += d * d;
    sum3 += d * d * d;
    if (maxd < d) maxd = d;
  }

  printf("%.6lf\n", sum1);
  printf("%.6lf\n", sqrt(sum2));
  printf("%.6lf\n", pow(sum3, 1.0 / 3));
  printf("%.6lf\n", maxd);

  return 0;
}

