#include using namespace std; #define rep(i,n) for (int i = 0; i < (int)(n); ++i) #define rrep(i,n) for (int i = (int)(n-1); i >= 0; --i) #define Rep(i,a,b) for (int i = a; i < b; ++i) #define rRep(i,a,b) for (int i = a; i > b; --i) #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define Bit(x,i) (((x)>>(i))&1) using ll = long long; using vi = vector; using vll = vector; using vvi = vector; using vvll = vector; using vb = vector; using vs = vector; using pii = pair; using pll = pair; templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b par; UnionFind() { } UnionFind(int n) : par(n, -1) { } void init(int n) { par.assign(n, -1); } int root(int x) { if (par[x] < 0) return x; else return par[x] = root(par[x]); } bool issame(int x, int y) { return root(x) == root(y); } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (par[x] > par[y]) swap(x, y); par[x] += par[y]; par[y] = x; return true; } int size(int x) { return -par[root(x)]; } }; vll X; UnionFind uf(200100); int main() { ll N, A, B; cin >> N >> A >> B; rep(i, N) { ll x; cin >> x; X.push_back(x); } rep(i, N) { int ldx = lower_bound(all(X), X[i]+A) - X.begin(); int rdx = lower_bound(all(X), X[i]+B+1) - X.begin() - 1; if(ldx > rdx) continue; uf.merge(i, ldx); uf.merge(i, rdx); while(ldx < rdx) { if(uf.issame(ldx, ldx+1)) break; uf.merge(ldx, ldx+1); ldx++; } while(ldx < rdx) { if(uf.issame(rdx-1, rdx)) break; uf.merge(rdx-1, rdx); rdx--; } } rep(i, N) { cout << uf.size(i) << endl; } }