#include using namespace std; #define rep(i,n) for(int i = 0; i < int(n); i++) #define per(i,n) for(int i = (n) - 1; 0 <= i; i--) #define rep2(i,l,r) for(int i = (l); i < int(r); i++) #define per2(i,l,r) for(int i = (r) - 1; int(l) <= i; i--) #define MM << " " << #define pb push_back #define eb emplace_back #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define sz(x) (int)x.size() template void print(const vector &v, T x = 0) { int n = v.size(); for (int i = 0; i < n; i++) cout << v[i] + x << (i == n - 1 ? '\n' : ' '); if (v.empty()) cout << '\n'; } using ll = long long; using pii = pair; using pll = pair; template bool chmax(T &x, const T &y) { return (x < y) ? (x = y, true) : false; } template bool chmin(T &x, const T &y) { return (x > y) ? (x = y, true) : false; } // const ll MOD = 1'000'000'007; const ll MOD = 998'244'353; /////////////////////////////////////////////////////////////// template using minheap = priority_queue, greater>; template using maxheap = priority_queue; template int lb(const vector &v, T x) { return lower_bound(begin(v), end(v), x) - begin(v); } template int ub(const vector &v, T x) { return upper_bound(begin(v), end(v), x) - begin(v); } template void rearrange(vector &v) { sort(begin(v), end(v)); v.erase(unique(begin(v), end(v)), end(v)); } class UnionFind { int _n; int _size; std::vector par_size; public: UnionFind() :_n(0), _size(0){} UnionFind(int n) : _n(n), _size(n), par_size(n, -1) {} int unite(int a, int b) { assert(0 <= a && a < _n); assert(0 <= b && b < _n); a = root(a), b = root(b); if(a == b) return a; _size--; if(-par_size[a] < -par_size[b]) { par_size[b] += par_size[a]; return par_size[a] = b; } else { par_size[a] += par_size[b]; return par_size[b] = a; } } int root(int a) { assert(0 <= a && a < _n); if(par_size[a] < 0) return a; return par_size[a] = root(par_size[a]); } bool same(int a, int b) { assert(0 <= a && a < _n); assert(0 <= b && b < _n); return root(a) == root(b); } int size(int a) { assert(0 <= a && a< _n); return -par_size[root(a)]; } int size() {return _size;} std::vector> groups() { std::vector leader_buf(_n), group_size(_n); for (int i = 0; i < _n; i++) { leader_buf[i] = root(i); group_size[leader_buf[i]]++; } std::vector> result(_n); for (int i = 0; i < _n; i++) { result[i].reserve(group_size[i]); } for (int i = 0; i < _n; i++) { result[leader_buf[i]].push_back(i); } result.erase( std::remove_if(result.begin(), result.end(), [&](const std::vector& v) { return v.empty(); }), result.end()); return result; } }; int main() { int n, a, b; cin >> n >> a >> b; vector da(n); rep(i,n) cin >> da[i]; vector ps(n+1); da.eb(INT_MAX-10); UnionFind uf(n); int f = 0, g = 0; rep(i,n) { while(da[f] - da[i] < a) { f++; } while(da[g] - da[i] <= b) { g++; } if(da[f] - da[i] <= b) { ps[f]++; uf.unite(i, f); ps[g-1]--; uf.unite(i, g-1); } } rep(i,n) ps[i+1] += ps[i]; rep2(i,0,n-1) if(ps[i] > 0) uf.unite(i, i+1); rep(i,n) cout << uf.size(i) << endl; }