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

#define ul unsigned long int
#define ull unsigned long long
#define li long long int

int main()
{
  ul n;
  cin>>n;
  int x[100],y;
  for (ul i = 0; i < n; i++)
    cin >> x[i];
  double d[4] = {0.0, 0.0, 0.0, 0.0},cd=0.0;
  for (ul i = 0; i < n; i++)
  {
    cin >> y;
    cd = abs(x[i] - y);
    d[0] += cd;
    d[1] += cd*cd;
    d[2] += cd*cd*cd;
    d[3] = max(d[3],cd);
  }
  d[1] = sqrt(d[1]);
  d[2] = cbrt(d[2]);
  cout<<fixed<<setprecision(16);
  for (ul i=0;i<4;i++) cout <<d[i]<<endl;


  return 0;
}

