#include using namespace std; #define rep(i,n) for(ll i=0;i=0;i--) #define perl(i,r,l) for(ll i=r-1;i>=l;i--) #define fi first #define se second #define pb push_back #define ins insert #define pqueue(x) priority_queue,greater> #define all(x) (x).begin(),(x).end() #define CST(x) cout<; using vvl=vector>; using pl=pair; using vpl=vector; using vvpl=vector; const ll MOD=1000000007; const ll MOD9=998244353; const int inf=1e9+10; const ll INF=4e18; const ll dy[8]={1,0,-1,0,1,1,-1,-1}; const ll dx[8]={0,1,0,-1,1,-1,1,-1}; template inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); } template inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); } struct UnionFind { vector par; vector edge; UnionFind(int n) : par(n, -1),edge(n, 0) {} int root(int x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool same(int x, int y) { return root(x) == root(y); } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) { edge[x]++; return false; } if (par[x] > par[y]) swap(x, y); par[x] += par[y]; par[y] = x; edge[x] += edge[y]+1; return true; } int size(int x) { return -par[root(x)]; } }; struct iv{ ll left,right,idx; bool operator<(const iv &b) const{ return left st; Intervals(){ iv rt; rt.left=-INF,rt.right=-INF; st.insert(rt); rt.left=INF,rt.right=INF; st.insert(rt); } bool overlap(iv p,iv q){ //もし[x,y)と[y,z)を統合したくないなら後ろの等号を外す return (p.left<=q.left&&q.left cand; vector ids; while(true){ auto q=*x; if(overlap(p,q)){ if(q.left<=p.left){ if(q.left!=p.left)cand.push_back({q.left,p.left}); } if(p.right<=q.right){ if(p.right!=q.right)cand.push_back({p.right,q.right}); } ids.push_back(x->idx); x=st.erase(x); } else if(q.right<=p.left)x++; else break; } for(auto q:cand)st.insert(q); return ids; } iv get(ll i){//iを含む区間を返す もしそのような区間がなければ、{-INF,INF}を返す auto x=st.upper_bound({i,INF});x--; if(x->left<=i&&iright)return *x; else { iv ret;ret.left=-INF,ret.right=INF; return ret; } } bool same(ll l,ll r){//lとrが同じ区間に属しているか  if(get(l).left==-INF)return false; else return get(l)==get(r); } ll mex(iv p){//区間pに含まれ、stに含まれないようなiのうち、もっとも左の座標 区間pが全て埋まっているなら、INFを返す ll left=p.left; while(left enumerate(iv p){//区間pとかぶる区間を列挙 auto x=st.lower_bound(p);x--; vector cand; while(true){ auto q=*x; if(overlap(p,q)){ cand.push_back(q); x++; } else if(q.right<=p.left)x++; else break; } return cand; } }; int main(){ ll n,a,b;cin >> n >> a >> b; UnionFind uf(n); Intervals ivs; rep(i,n){ ll v;cin >> v; iv p;p.left=v-b,p.right=v-a+1; auto cand=ivs.enumerate(p); //for(auto q:cand)cout << q.left <<" " << q.right <<" ";cout << endl; for(auto q:cand)uf.merge(i,q.idx); for(auto q:cand)ivs.split(q); if(cand.size()){ ivs.insert({cand.front().left,cand.back().right,cand.front().idx}); } ivs.insert({v,v+1,i}); //ivs.view(); } rep(i,n)cout << uf.size(i) << endl; }