object Main {
  def d(a: Seq[Double], b: Seq[Double], p: Int): Double =
    math.pow((a zip b).foldLeft(0.0d){ case (s, t) => s + math.pow(math.abs(t._1 - t._2), p) }, 1.0d / p)

  def di(a: Seq[Double], b: Seq[Double]): Double =
    (a zip b).map(t => math.abs(t._1 - t._2)).max
  def main(args: Array[String]): Unit = {
    val scanner = new java.util.Scanner(System.in)

    val n = scanner.nextInt
    val a = Seq.fill(n)(scanner.nextDouble)
    val b = Seq.fill(n)(scanner.nextDouble)

    println(d(a, b, 1))
    println(d(a, b, 2))
    println(d(a, b, 3))
    println(di(a, b))
  }
}

