#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define llint long long #define inf 1e18 #define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++) #define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++) #define chmin(x, y) (x) = min((x), (y)) #define chmax(x, y) (x) = max((x), (y)) using namespace std; typedef pair P; struct UnionFind{ int size; vector parent; UnionFind(){} UnionFind(int size){ this->size = size; parent.resize(size+1); init(); } void init(){ for(int i = 0; i <= size; i++) parent[i] = i; } int root(int i){ if(parent[i] == i) return i; return parent[i] = root(parent[i]); } bool same(int i, int j){ return root(i) == root(j); } void unite(int i, int j){ int root_i = root(i), root_j = root(j); if(root_i == root_j) return; parent[root_i] = root_j; } }; llint n, a, b; llint x[200005]; set

S; UnionFind uf(200005); map mp; int main(void) { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> a >> b; for(int i = 1; i <= n; i++) cin >> x[i]; for(llint i = 1; i <= n; i++){ auto it = S.lower_bound(P(x[i]-b, -inf)); llint mn = inf, mx = -inf; for(;it != S.end() && it->first <= x[i]-a; it++){ uf.unite(it->second, i); mn = min(mn, it->second), mx = max(mx, it->second); } it = S.lower_bound(P(x[i]-b, -inf)); for(;it != S.end() && it->first <= x[i]-a;){ //cout << "D " << it->first << endl; auto tmp = it; it++; S.erase(tmp); } if(mn < inf/2){ S.insert(P(x[mn], mn)); S.insert(P(x[mx], mx)); //cout << mn << " " << mx << endl; } S.insert(P(x[i], i)); } for(int i = 1; i <= n; i++) mp[uf.root(i)]++; for(int i = 1; i <= n; i++) cout << mp[uf.root(i)] << "\n"; flush(cout); return 0; }