
import java.util.*


fun main(args : Array<String>) {

  val scanner = Scanner(System.`in`)

  val len = scanner.nextInt()

  scanner.nextLine()

  val xList = scanner.nextLine().split(" ")
  val yList = scanner.nextLine().split(" ")


  for ( p in listOf(1.0, 2.0, 3.0, -1.0) ) {

    var D = 0.0
    var sigma = 0.0

    if (p != -1.0) {

      for ( i in 0 until len) {
        sigma += Math.pow( Math.abs( xList[i].toDouble() - yList[i].toDouble() ), p )
      }

      D = Math.pow( sigma, 1.0/p )

    } else {

      for ( i in 0 until len) {
        D = Math.max(D, Math.abs( xList[i].toDouble() - yList[i].toDouble() ) )
      }

    }

    println("%.8f".format(D))

  }

}

