var input = ""
process.stdin.resume();
process.stdin.setEncoding('utf-8');
process.stdin.on('data', function(chunk) {
  input += chunk;
});
 
process.stdin.on('end', function() {
  input = input.split("\n");

  var n = input[0];
  var x = input[1].split(" ");
  var y = input[2].split(" ");

  for (i = 1; i <= 3; i++) {
    var sum = 0;
    for (j = 0; j < n; j++) {
      sum += Math.pow(Math.abs(x[j] - y[j]), i);
    }
    console.log(Math.pow(sum, (1/i)));
  }

  var max = 0;
  for (j = 0; j < n; j++) {
    if (Math.abs(x[j] - y[j]) > max) {
      max = Math.abs(x[j] - y[j]);
    }
  }
  console.log(max);
});