#include using namespace std; #define rep(i, n) for (int i = 0; i < (n); i++) #define ALL(v) (v).begin(), (v).end() using ll = long long; constexpr int INF = 1e9; constexpr long long LINF = 1e18; constexpr long long MOD = 1e9 + 7; #define MAX 200000 struct UnionFind { vector par, siz; UnionFind(int n) : par(n), siz(n, 1) { iota(par.begin(), par.end(), 0); } int root(int x) { if (par[x] == x) return x; else return par[x] = root(par[x]); } void unite(int x, int y) { x = root(x); y = root(y); if (x == y) return; if (siz[x] < siz[y]) swap(x, y); siz[x] += siz[y]; par[y] = x; } bool same(int x, int y) { return root(x) == root(y); } int size(int x) { return siz[root(x)]; } }; int n; ll a, b; ll x[MAX]; bool visited[MAX]; UnionFind uf(MAX); void dfs(int cur) { if (visited[cur]) return; visited[cur] = true; int l = lower_bound(x, x + n, x[cur] + a) - x; int r = upper_bound(x, x + n, x[cur] + b) - x; if (l < n) dfs(l); if (r - 1 > l) dfs(r - 1); for (int i = l; i < r; i++) { visited[i] = true; uf.unite(cur, i); } } signed main() { cin >> n >> a >> b; rep(i, n) { cin >> x[i]; } rep(i, n) { dfs(i); } rep(i, n) { cout << uf.size(i) << endl; } return 0; }