fun main(args: Array<String>) {
  val sc = java.util.Scanner(System.`in`)
  val N = sc.nextInt()
  val A = arrayOf(0) + Array(N) { sc.nextInt() } + arrayOf(0)
  val d = (0..(A.count() - 2)).map { i ->
                                    val d = A[i] - A[i + 1]
                                    if (d > 0) d else -d
                                   }
  val sum = d.sum()
  for (i in 0..(N-1)) {
    println(sum - d[i] - d[i + 1] + Math.abs(A[i] - A[i + 2]))
  }
}
