#include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, x, y; cin >> n >> x >> y; vector a(n); for (int i = 0; i < n; i++) cin >> a[i]; long long acc; vector pref(n); acc = x - a[0]; pref[1] = acc; for (int i = 2; i < n; i++) { if (acc < 0) acc = x - a[i-1]; else acc += x - a[i-1]; pref[i] = max(pref[i-1], acc); } vector suff(n); acc = y - a[n-1]; suff[n-2] = acc; for (int i = n-3; i >= 0; i--) { if (acc < 0) acc = y - a[i+1]; else acc += y - a[i+1]; suff[i] = max(suff[i+1], acc); } long long sum = 0; for (int i = 0; i < n; i++) sum += a[i]; for (int i = 1; i < n-1; i++) { long long ret = sum + pref[i] + suff[i]; cout << ret << endl; } return 0; }