fun main(args: Array<String>) {
    arc093a()
}

fun arc093a() {
    val n = readLine()!!.toInt()
    val aList = (listOf(0) + readLine()!!.split(' ').map { it.toInt() } + listOf(0))
        .toIntArray()

    val allSum = (1..n + 1).map { Math.abs(aList[it - 1] - aList[it]) }.sum()

    val answer = (1..n).map {
        val before = aList[it - 1]
        val curr = aList[it]
        val after = aList[it + 1]
        if (curr in before..after || curr in after..before) allSum else {
            allSum - Math.min(Math.abs(before - curr), Math.abs(after - curr)) * 2
        }
    }.joinToString(System.lineSeparator())

    println(answer)
}
