import kotlin.system.exitProcess

private fun distanceP(xValues: List<Double>, yValues: List<Double>, p: Int): Double {
    return Math.pow(xValues.zip(yValues).map {
        Math.pow(Math.abs(it.first - it.second), p.toDouble())
    }.sum(), 1 / p.toDouble())
}


private fun distanceChebyshev(xValues: List<Double>, yValues: List<Double>): Double {
    return xValues.zip(yValues).map { Math.abs(it.first - it.second) }.max()!!
}

fun main(args: Array<String>) {
    val elemNum = readLine()!!.toInt()
    if (elemNum == 0) {
        exitProcess(1)
    }
    val xValues = readLine()!!.split(" ").map(String::toDouble)
    val yValues = readLine()!!.split(" ").map(String::toDouble)
    println("${distanceP(xValues, yValues, 1)}")
    println("${distanceP(xValues, yValues, 2)}")
    println("${distanceP(xValues, yValues, 3)}")
    println("${distanceChebyshev(xValues, yValues)}")
}

