function main(lines) {
    const arrayX = lines.split('\n')[1].split(' ').map(Number)
    const arrayY = lines.split('\n')[2].split(' ').map(Number)

    let calcFirst = 0
    let calcSecond = 0
    let calcThird = 0
    for(let i=0; i<arrayX.length; i++){
        calcFirst += Math.pow(abs(arrayX[i] - arrayY[i]), 1)
        calcSecond += Math.pow(abs(arrayX[i] - arrayY[i]), 2)
        calcThird += Math.pow(abs(arrayX[i] - arrayY[i]), 3)
    }
    
    let calcInfinity = []
    for(let i=0; i<arrayX.length; i++){
        calcInfinity.push(abs(arrayX[i] - arrayY[i]))
    }
    
    console.log(calcFirst.toFixed(5))
    console.log((Math.pow(calcSecond, 1/2)).toFixed(5))
    console.log((Math.pow(calcThird, 1/3)).toFixed(5))
    console.log((Math.max(...calcInfinity)).toFixed(5))

    function abs(val){
        return val<0 ? -val : val;
    }
    
    
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

