process.stdin.resume();
process.stdin.setEncoding("utf8");

const reader = require("readline").createInterface({
  input: process.stdin,
  output: process.stdout,
});

const lines = [];

reader.on("line", (line) => {
  lines.push(line);
});

reader.on("close", () => {
  const n = lines[0] - 0;
  const f = (l) => l.split(" ").map(Number);
  const xs = f(lines[1]);
  const ys = f(lines[2]);
  let sum = 0;
  let sum2 = 0;
  let sum3 = 0;
  let max = 0;
  for (let i = 0; i < n; i++) {
    const xy = Math.abs(xs[i] - ys[i]);
    max = Math.max(max, xy);
    sum += xy;
    sum2 += xy * xy;
    sum3 += Math.pow(xy, 3);
  }
  console.log(sum);
  console.log(Math.sqrt(sum2).toFixed(5));
  console.log(Math.pow(sum3, 1 / 3).toFixed(5));
  console.log(max);
});

