import scala.math._

object Main extends App {
  val scanner = new java.util.Scanner(System.in)

  val n = scanner.nextInt()
  val xn = (1 to n).map(_ => scanner.nextInt())
  val yn = (1 to n).map(_ => scanner.nextInt())

  def D(xn: Seq[Int], yn: Seq[Int]): Seq[Double] = {
    val xy = (xn zip yn).map {
      case (x, y) => x - y
    }
    Seq(
      xy.sum,
      sqrt(xy.map(pow(_, 2)).sum),
      cbrt(xy.map(pow(_, 3)).sum),
      xy.max.toDouble
    )
  }

  val outputs = D(xn, yn)

  outputs.foreach(println)
}