import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val xs = mutableListOf<Int>()
    val ys = mutableListOf<Int>()
    (1..n).forEach {
        xs.add(scanner.nextInt())
    }
    (1..n).forEach {
        ys.add(scanner.nextInt())
    }

    val xys = xs.zip(ys)
    val f = { p: Pair<Int, Int> -> Math.abs(p.first - p.second) }

    println(xys.map(f).sum())
    println(Math.sqrt(xys.map { p -> Math.pow(f(p).toDouble(), 2.0) }.sum()))
    println(Math.cbrt(xys.map { p -> Math.pow(f(p).toDouble(), 3.0) }.sum()))
    println(xys.map(f).max())
}

