#include using namespace std; #define int long long #define ii pair #define app push_back #define all(a) a.begin(), a.end() #define bp __builtin_popcountll #define ll long long #define mp make_pair #define f first #define s second #define Time (double)clock()/CLOCKS_PER_SEC #define debug(x) std::cout << #x << ": " << x << '\n'; const int N = 2e5+7; map num; set nu; int comp[N], cnt[N]; int n, l, r; void dfs(int x, int c) { comp[num[x]] = c; cnt[c]++; nu.erase(x); while (1) { auto t = nu.lower_bound(x - r); if (t != nu.end() && *t <= x - l) { dfs(*t, c); } else { break; } } while (1) { auto t = nu.lower_bound(x + l); if (t != nu.end() && *t <= x + r) { dfs(*t, c); } else { break; } } } signed main() { #ifdef HOME freopen("input.txt", "r", stdin); #else #define endl '\n' ios_base::sync_with_stdio(0); cin.tie(0); #endif cin >> n >> l >> r; vector a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; nu.insert(a[i]); num[a[i]] = i; } int c = 0; while (nu.size()) { dfs(*nu.begin(), c++); } for (int i = 0; i < n; ++i) { cout << cnt[comp[i]] << endl; } }