#include using namespace std; template bool cmin(A& a, B b) { return a > b && (a = b, true); } template bool cmax(A& a, B b) { return a < b && (a = b, true); } signed main() { cin.tie(nullptr)->sync_with_stdio(false); long N, X, Y; cin >> N >> X >> Y; vector A(N); for (long i = 0; i < N; i++) cin >> A.at(i); auto B = A; for (long i = 0; i < N; i++) { B.at(i) = X - B.at(i); } vector L(N); for (long i = 0, now = 0, mx = LONG_MIN; i < N; i++) { now += B.at(i); cmax(mx, now); if (now < 0) now = 0; L.at(i) = mx; } auto C = A; for (long i = 0; i < N; i++) { C.at(i) = Y - C.at(i); } vector R(N); for (long i = N - 1, now = 0, mx = LONG_MIN; i >= 0; i--) { now += C.at(i); cmax(mx, now); if (now < 0) now = 0; R.at(i) = mx; } long acc = accumulate(A.begin(), A.end(), 0L); for (long i = 1; i + 1 < N; i++) { cout << acc + L.at(i - 1) + R.at(i + 1) << '\n'; } }