object Main extends App {

  override def main(args: Array[String]): Unit = {

    val n = io.StdIn.readLine.toInt

    val v1 = new vector(n, io.StdIn.readLine.split(' ').toList.map(_.toDouble))
    val v2 = new vector(n, io.StdIn.readLine.split(' ').toList.map(_.toDouble))

    val dist = v1.distance(v2);
    
    println(dist._1)
    println(dist._2)
    println(dist._3)
    println(dist._4)
  }

  class vector(val div: Int, val list: List[Double]) {
    def distance(target: vector): (Double, Double, Double, Double) = {
      (distance1From(target),
        distance2From(target),
        distance3From(target),
        distanceInfFrom(target))
    }

    def distance1From(target: vector): Double = {
      list.zip(target.list).map(xyi => Math.abs(xyi._1 - xyi._2)).sum
    }

    def minkowskiDistance(p: Int, target: vector): Double = {
      Math.pow(list.zip(target.list).map(xyi => Math.pow(Math.abs(xyi._1 - xyi._2), p)).sum, 1 / p.toDouble)
    }

    def distance2From(target: vector): Double = minkowskiDistance(2, target)
    def distance3From(target: vector): Double = minkowskiDistance(3, target)

    def distanceInfFrom(target: vector): Double = {
      list.zip(target.list).map(xyi => Math.abs(xyi._1 - xyi._2)).max
    }

  }
}