object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val vectorX = List.fill(n)(sc.nextInt())
  val vectorY = List.fill(n)(sc.nextInt())
  calcAndPrint(vectorX, vectorY, 1.0)
  calcAndPrint(vectorX, vectorY, 2.0)
  calcAndPrint(vectorX, vectorY, 3.0)
  calcInfAndPrint(vectorX, vectorY)

  def calcAndPrint(v1: List[Int], v2: List[Int], p: Double): Unit = {
    println(f"${v1.zip(v2).map(e => (e._1 - e._2).abs.toString.toBigDecimal.power(p)).sum.root(p)}%.6f")
  }

  def calcInfAndPrint(v1: List[Int], v2: List[Int]): Unit = {
    println(f"${v1.zip(v2).map(e => (e._1 - e._2).abs).max}%.6f")
  }

  implicit class StringExtends(val s: String) extends AnyVal {
    def toBigDecimal = BigDecimal(s)
  }

  implicit class DoubleExtends(val d: Double) extends AnyVal {
    def toBigDecimal = BigDecimal(d)
  }

  implicit class BigDecimalExtends(val b: BigDecimal) extends AnyVal {

    import scala.math.pow

    def power(d: Double) = pow(b.toDouble, d).toBigDecimal

    def root(d: Double) = pow(b.toDouble, 1.0 / d).toBigDecimal
  }

}