import java.util.Scanner

object Main extends App {

  def distance2() = {
    val sc = new Scanner(System.in)

    def nextInt() = sc.next.toInt

    val n = nextInt
    val xs = List.fill(n)(nextInt)
    val ys = List.fill(n)(nextInt)

    
    val manhattan = {
      var acc = 0.0
      for ((x, y) <- xs zip ys) 
        acc += math.abs(x - y)
      acc
    }

    val p2 = {
      var acc = 0.0
      for ((x, y) <- xs zip ys) 
        acc += (x - y) * (x - y)
      math.sqrt(acc)
    }

    val p3 = {
      var acc = 0.0
      for ((x, y) <- xs zip ys) {
        val d = math.abs(x - y)
        acc += d * d * d
      }
      math.cbrt(acc)
    }

    val chebyshev = {
      for ((x, y) <- xs zip ys)
      yield math.abs(x - y)
    }.max

    println(manhattan)
    println(p2)
    println(p3)
    println(chebyshev)
  }

  distance2()
}

