import scala.io.StdIn
import Math.{abs,pow,sqrt,cbrt}
/**
  * AOJ
  */
object Main {

  def main(args: Array[String]): Unit = {
    StdIn.readInt()

    def read(): Array[Double] ={StdIn.readLine().split(" ").map(_.toDouble)}
    val xArray = read()
    val yArray = read()

    val list = (xArray zip yArray).map(x => abs(x._1 - x._2))
    val p1 = list.sum
    val p2 = sqrt(list.map(pow(_,2)).sum)
    val p3 = cbrt(list.map(pow(_,3)).sum)
    val pInfinity = list.max

    val format = "%.6f"
    println(format.format(p1))
    println(format.format(p2))
    println(format.format(p3))
    println(format.format(pInfinity))
  }
}