#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) repr(i, 0, n) #define INF 2e9 #define MOD 1000000007 //#define MOD 998244353 #define LINF (long long)4e18 #define jck 3.141592 const double EPS = 1e-10; using ll = long long; using Pi = pair; using Pl = pair; class DisjointSet{ public: vector rank,p,siz; DisjointSet(){} DisjointSet(ll size){ rank.resize(size,0); p.resize(size,0); siz.resize(size,1); rep(i,size) makeSet(i); } void makeSet(ll x){ p[x] = x; rank[x] = 0; } bool same(ll x, ll y){ return root(x) == root(y); } void unite(ll x, ll y){ x = root(x); y = root(y); if(rank[x] > rank[y]){ siz[x] += siz[y]; p[y] = x; } else{ siz[y] += siz[x]; p[x] = y; if(rank[x] == rank[y]) rank[y]++; } } ll root(ll x){ if(x != p[x]){ p[x] = root(p[x]); } return p[x]; } ll size(ll x){ return siz[root(x)]; } }; int main(){ int n,a,b; cin >> n >> a >> b; vector x(n); rep(i,n) cin >> x[i]; DisjointSet uf(n); int nowmax = 0; rep(i,n){ int d = upper_bound(x.begin(),x.end(),x[i]+b)-x.begin(); int d2 = lower_bound(x.begin(),x.end(),x[i]+a)-x.begin(); if(d2 < nowmax){ repr(j,nowmax-1,d){ if(!uf.same(i,j)) uf.unite(i,j); } } else{ repr(j,d2,d){ if(!uf.same(i,j)) uf.unite(i,j); } } nowmax = max(nowmax,d); } rep(i,n){ cout << uf.size(i) << endl; } }