#include #define rep(i,N) for(int i=0;i<(N);i++) #define rrep(i, n) for (int i = (int)n-1; i >= 0; --i) #define FOR(i,a,b) for(int i=(a);i<(b);i++) using namespace std; const long long MOD = 1e9 + 7; const long long INF = 1e12; const int inf = 1e9; const int mod = 1e9+7; typedef long long ll; typedef pair P; typedef set S; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } __attribute__ ((constructor)) void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(10); } int main(){ int n; ll x, y; cin >> n >> x >> y; vector a(n); vector a_rev; vector sum_x(n + 1, 0); vector sum_y(n + 1, 0); vector ans_x(n); vector ans_y(n); rep(i, n) cin >> a[i]; reverse(a.begin(), a.end()); a_rev = a; reverse(a.begin(), a.end()); rep(i, n) { sum_x[i + 1] = sum_x[i] + x - a[i]; } rep(i, n) { sum_y[i + 1] = sum_y[i] + y - a_rev[i]; } ll min_x , max_x; ll min_y, max_y; rep(i,n){ // cout << min_x << " " << max_x << endl; // cout << min_y << " " << max_y << endl; // cout << "-----------------------" << endl; if(i == 0){ ans_x[i] = sum_x[i + 1]; ans_y[i] = sum_y[i + 1]; min_x = min(sum_x[i], sum_x[i+1]); max_x = max(sum_x[i], sum_x[i+1]); min_y = min(sum_y[i], sum_y[i+1]); max_y = max(sum_y[i], sum_y[i+1]); }else{ chmax(max_x, sum_x[i + 1]); chmax(max_y, sum_y[i + 1]); ans_x[i] = max_x - min_x; ans_y[i] = max_y - min_y; chmin(min_x, sum_x[i + 1]); chmin(min_y, sum_y[i + 1]); } } ll all_sum = accumulate(a.begin(), a.end(), 0ll); FOR(i,1,n-1){ ll pre = all_sum; all_sum += ans_x[i - 1]; all_sum += ans_y[n - i - 2]; cout << all_sum << endl; all_sum = pre; } return 0; }