import kotlin.math.max import kotlin.math.min fun main() { val (n, x, y) = readLine()!!.split(" ").map { it.toInt() } var a = readLine()!!.split(" ").map { it.toLong() } var sum = a.toMutableList() for (i in 1 until n) { sum[i] += sum[i - 1] } val ans = a.toMutableList() var diff = a.map { x - it } var mi = 0L var acc = 0L var ma = -2000000000L for (i in 1 until n - 1) { acc += diff[i - 1] ma = max(ma, acc - mi) ans[i] += sum[i - 1] + ma mi = min(mi, acc) } a = a.reversed() sum = a.toMutableList() for (i in 1 until n) { sum[i] += sum[i - 1] } diff = a.map { y - it } mi = 0L acc = 0L ma = -2000000000L for (i in 1 until n - 1) { acc += diff[i - 1] ma = max(ma, acc - mi) ans[n - 1 - i] += sum[i - 1] + ma mi = min(mi, acc) } println(ans.subList(1, n - 1).joinToString("\n")) }