#include using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n, a, b; cin >> n >> a >> b; vector x(n); for (int i = 0; i < n; i++) cin >> x[i]; vector g(n, -1); vector cnt(n); set > r; for (int i = 0; i < n; i++) r.insert(make_pair(x[i], i)); for (int v = 0; v < n; v++) { if (g[v] == -1) { queue q; q.push(v); g[v] = v; ++cnt[v]; r.erase(make_pair(x[v], v)); while (!q.empty()) { int w = q.front(); q.pop(); // 左にあるもの auto ls = r.lower_bound(make_pair(x[w] - b, 0)); auto lt = r.upper_bound(make_pair(x[w] - a, n)); while (ls != lt) { int u = ls->second; q.push(u); g[u] = v; ++cnt[v]; ++ls; r.erase(make_pair(x[u], u)); } // 右にあるもの auto rs = r.lower_bound(make_pair(x[w] + a, 0)); auto rt = r.upper_bound(make_pair(x[w] + b, n)); while (rs != rt) { int u = rs->second; q.push(u); g[u] = v; ++cnt[v]; ++rs; r.erase(make_pair(x[u], u)); } } } } for (int i = 0; i < n; i++) cout << cnt[g[i]] << endl; return 0; }