#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define MT make_tuple #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)<; using vi = vector; using vll = vector; void solve() { int N, A, B; cin >> N >> A >> B; map K; // indices set S; rep(i, N) { int x; cin >> x; K[x] = i; S.insert(x); } vi ans(N); while (!S.empty()) { int a = *S.begin(); S.erase(a); vi CC; CC.push_back(a); int k = 0; auto f = [&](int l, int r) { while (true) { auto it = S.lower_bound(l); if (it != S.end() && *it <= r) { CC.push_back(*it); S.erase(it); } else { break; } } }; while (k < sz(CC)) { int x = CC[k++]; f(x - B, x - A); f(x + A, x + B); } each(c, CC) { ans[K[c]] = sz(CC); } } each(a, ans) { cout << a << endl; } } int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(15); solve(); return 0; }