#pragma GCC optimize("Ofast") #include #include #include using namespace std; using namespace __gnu_pbds; using ll = long long; using ull = unsigned long long; using pii = pair; using pll = pair; #define rep(i, n) for(int i = 0; i < (n); ++i) #define all(x) (x).begin(),(x).end() constexpr char ln = '\n'; constexpr long long MOD = 1000000007; //constexpr long long MOD = 998244353; template inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; } template inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; } inline int popcount(int x) {return __builtin_popcount(x);} inline int popcount(long long x) {return __builtin_popcountll(x);} void print() { cout << "\n"; } template void print(const T &x, const Args &... args) { cout << x << " "; print(args...); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// struct UnionFind { int N; vector node; UnionFind(){} UnionFind(int N) : N(N), node(N,-1) {} void init(int x) { node.assign(x,-1); N = x; } bool merge(int x, int y) { x = root(x); y = root(y); if (x == y) return false; if (node[x] > node[y]) swap(x,y); node[x] += node[y]; node[y] = x; N--; return true; } bool same(int x, int y) {return root(x) == root(y);} int root(int x) { if (node[x] < 0) return x; return node[x] = root(node[x]); } int size(int x) {return -node[root(x)];} int count() const {return N;} }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N,A,B; cin >> N >> A >> B; vector x(N); rep(i,N) cin >> x[i]; UnionFind uf(N); vector C; rep(i,N) { int l = lower_bound(all(x),x[i]+A) - x.begin(); int r = upper_bound(all(x),x[i]+B) - x.begin(); if (l < r) { uf.merge(i,l); C.emplace_back(l,r); } } int M = C.size(); int cur = 0; int r = 0; rep(i,N) { while (cur < M and C[cur].first < i) { chmax(r,C[cur].second); cur++; } if (i < r) { uf.merge(i,i-1); } } rep(i,N) cout << uf.size(i) << ln; }