#include #define rep(a,n) for (ll a = 0; a < (n); ++a) using namespace std; //using namespace atcoder; using ll = long long; typedef pair P; typedef pair PP; typedef vector > Graph; 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; } const ll INF = 1e18+7; #define debug(v) cout<<#v<<": ",prt(v); template inline void prt(pair p){cout<<"("< inline void prt(tuple p){cout<<"("<(p)<<", "<(p)<<", "<(p)<<")\n";} inline void prt(bool p){if(p)cout<<"True"<<'\n';else cout<<"False"<<'\n';} template inline void prt(vector v){cout<<'{';for(ll i=0;i inline void prt(vector >& vv){ for(const auto& v : vv){ prt(v); } } template inline void prt(deque v){cout<<'{';for(ll i=0;i inline void prt(map v){cout<<'{';ll c=0;for(auto &p: v){cout< inline void prt(unordered_map v){cout<<'{';ll c=0;for(auto &p: v){cout< inline void prt(set v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';} template inline void prt(multiset v){cout<<'{';for(auto i=v.begin();i!=v.end();i++){cout<<*i;if(i!=--v.end())cout<<", ";}cout<<'}'<<'\n';} /* 方針 Mを大きくするときにその都度計算すれば良さそう */ int main(){ ll n,x,y; cin >> n >> x >> y; vectora(n); rep(i,n)cin>>a[i]; vectorxdiff(n+1,0); rep(i,n){ xdiff[i+1]=x-a[i]+xdiff[i]; } vectorydiff(n+2,0); for(int i=n;i>=1;i--){ ydiff[i]=y-a[i-1]+ydiff[i+1]; } ll s = accumulate(a.begin(),a.end(),0); //cout << s << endl; ll xMax = -INF; ll yMax = -INF; ll xMin = 0; ll yMin = 0; vectorans(n,s); for(int i=2;i<=n-1;i++){ chmax(xMax,xdiff[i-1]-xMin); chmin(xMin,xdiff[i-1]); ans[i]+=xMax; } //debug(ans); //debug(ydiff); for(int i=n-1;i>=2;i--){ chmax(yMax,ydiff[i+1]-yMin); chmin(yMin,ydiff[i+1]); ans[i]+=yMax; } for(int i=2;i<=n-1;i++){ cout << ans[i] << endl; } return 0; }