const input = require('fs').readFileSync('/dev/stdin', 'utf8').split(/\n/);
let x = input[1].split(' ').map(Number);
let y = input[2].split(' ').map(Number);
let p1 = 0;
let p2 = 0;
let p3 = 0;
let inf = 0;
for (let i = 0; i < x.length; i++) {
    p1 += Math.abs(x[i]-y[i]);
    p2 += Math.pow(Math.abs(x[i]-y[i]), 2);
    p3 += Math.pow(Math.abs(x[i]-y[i]), 3);
    if (inf < Math.abs(x[i]-y[i])) {
    inf = Math.abs(x[i]-y[i]);
    }
}
p2 = Math.sqrt(p2);
p3 = Math.cbrt(p3);
console.log(p1.toFixed(6));
console.log(p2.toFixed(6));
console.log(p3.toFixed(6));
console.log(inf.toFixed(6));
