import scala.io.StdIn.{readLine,readDouble}

object Main extends App {

  val n = readDouble
  val v1 = readLine.split(" ").map(_.toDouble)
  val v2 = readLine.split(" ").map(_.toDouble)

  val p1 = (v1,v2).zipped.foldLeft(0d) {(x,y)=> x + Math.abs(y._1 - y._2)}
  val p2 = (v1,v2).zipped.foldLeft(0d) {(x,y)=> x + Math.pow(y._1 - y._2,2)}
  val p3 = (v1,v2).zipped.foldLeft(0d) {(x,y)=> x + Math.pow(Math.abs(y._1 - y._2),3)}
  val pinf = (v1,v2).zipped.foldLeft(0d) {(x,y)=> Math.max(x,Math.abs(y._1 - y._2))}

  println(p1)
  println(Math.sqrt(p2))
  println(Math.cbrt(p3))
  println(pinf)
}