let input = require("fs").readFileSync("/dev/stdin","utf-8");

let lines = input.split("\n");
let count = parseInt(lines.shift());
let x = lines.shift().split(" ").map(item=>parseInt(item));
let y = lines.shift().split(" ").map(item=>parseInt(item));

function dit(p){
    let put = 0;
    for(let i=0;i<count;i++){
        put+= Math.pow(Math.abs(x[i]-y[i]),p);
    }
    return Math.pow(put,(1/p));
}

for(let i=1;i<4;i++){
    console.log(dit(i));
}
let max =0;
for(let i=0;i<count;i++){
    let diff = Math.abs(x[i]-y[i]);
    if(diff>max){
        max = diff;
    }
}
console.log(max);
