/**
  * http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ITP1_10_D&lang=jp
  * Math Functions - Distance II
  */
object Main {
  def main(args: Array[String]): Unit = {
    val n = io.StdIn.readInt()
    val x = io.StdIn.readLine().split(" ").map(_.toInt)
    val y = io.StdIn.readLine().split(" ").map(_.toInt)
    println(manhattanDistance(x, y))
    println(euclidDistance(x, y))
    println(minkowskiDistance(3, x, y))
    println(chebyshevDistance(x, y))
  }

  def minkowskiDistance(p: Int, x: Seq[Int], y: Seq[Int]): Double = {
    math.pow(
      (x zip y).foldLeft(0.0) {
        (acc, pair) => acc + math.pow(math.abs(pair._1 - pair._2), p)
      }, 1.0 / p)
  }

  def manhattanDistance(x: Seq[Int], y: Seq[Int]): Double = {
    minkowskiDistance(1, x, y)
  }

  def euclidDistance(x: Seq[Int], y: Seq[Int]): Double = {
    minkowskiDistance(2, x, y)
  }

  def chebyshevDistance(x: Seq[Int], y: Seq[Int]): Double = {
    (x zip y).map(pair => math.abs(pair._1 - pair._2)).max
  }

}