fun main(args: Array<String>) {
    val x = readLine()!!.toInt()
    val l = listOf(0) + readLine()!!.split(" ").map{it.toInt()} + listOf(0)
    var total = 0
    for(i in 0 until x + 1){
        total += Math.abs(l[i + 1] - l[i])
    }
    for (i in 1 until x + 1) {
        when {
            l[i] in l[i - 1]..l[i + 1] || l[i] in l[i + 1]..l[i - 1] -> println(total)
            l[i] > l[i - 1] && l[i] > l[i + 1] -> println(total - (l[i] - Math.max(l[i - 1], l[i + 1])) * 2)
            l[i] < l[i - 1] && l[i] < l[i + 1] -> println(total + (l[i] - Math.min(l[i - 1], l[i + 1])) * 2)
        }
    }
}