import Math._
object Main extends App {
  val n = readLine.toInt
  val xs = readLine.split(' ').map(_.toDouble).take(n)
  val ys = readLine.split(' ').map(_.toDouble).take(n)

  val diff = xs.zip(ys).map(t => abs(t._1 - t._2))

  for (p <- 1 to 3) {
    println(pow(diff.map(pow(_,p)).sum, 1.0/p))
  }
  println(diff.max)
}
