#include using namespace std; typedef long long ll; #define REP(i, n) for(ll i=0; i=0; i--) #define FOR(i, m, n) for(ll i=m; i; 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 int INF = 2e9; const ll LINF = (1LL<<60); struct UnionFind { vector par; 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); // merge technique par[x] += par[y]; par[y] = x; return true; } int size(int x) { return -par[root(x)]; } }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n,a,b; cin >> n >> a >> b; vector x(n); REP(i,n) cin >> x[i]; UnionFind tree(n); REP(i,n-1){ int left = lower_bound(ALL(x), x[i]+a) - x.begin(); int right = upper_bound(ALL(x), x[i]+b) - x.begin(); FOR(j,left, right){ tree.merge(i, j); } } REP(i,n) cout << tree.size(i) << '\n'; return 0; }