#include using namespace std; typedef long long ll; const int nax = 2e5 + 7; vectorpar(nax); vectorsiz(nax, 1); int get(int x) { if (x == par[x])return x; return (par[x]) = get(par[x]); } void unite(int x, int y) { x = get(x); y = get(y); if (x == y)return ; if (siz[y] > siz[x])swap(x, y); par[y] = x; siz[x] += siz[y]; } void foo() { iota(par.begin(), par.end(), 0); } int main() { #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); foo(); int n, a, b; cin >> n >> a >> b; vectorv(n); for (int i = 0; i < n; i++) { cin >> v[i]; } int lower = 0, upper = 0; set>s; for (int i = 0; i < n; i++) { int l = lower_bound(v.begin(), v.end(), v[i] + a) - v.begin(); lower = max(lower, l); upper = upper_bound(v.begin(), v.end(), v[i] + b) - v.begin(); if (upper != 0)upper--; for (int j = lower; j <= upper; j++) { s.insert({i, j}); } lower = upper - 1; } for (auto k : s) { int x = k.first; int y = k.second; unite(x, y); } for (int i = 0; i < n; i++) { cout << siz[get(i)] << endl; } }