#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using namespace atcoder; using Graph = vector>; using ll = long long; typedef pair P_ll; typedef pair P; const ll INF_ll = 1e17; const int INF = 1e8; template bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } template bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } template using min_priority_queue = priority_queue, greater>; int main() { ll N, A, B; cin >> N >> A >> B; vector x(N); vector> y; for (int i = 0; i < N; i++) { cin >> x[i]; y.push_back({x[i], {1, i}}); y.push_back({x[i] + A, {0, i}}); } dsu tree(N); sort(y.begin(), y.end()); min_priority_queue pq; for (int i = 0; i < y.size(); i++) { auto p = y[i]; // cout << p.first << " " << p.second.first << " " << p.second.second << // endl; if (p.second.first == 1) { P_ll max_r = {-1, -1}; while (!pq.empty()) { auto pp = pq.top(); pq.pop(); if (pp.first >= p.first) { tree.merge(p.second.second, pp.second); chmax(max_r, pp); } } if (max_r.first > 0) { pq.push(max_r); } } else { pq.push({x[p.second.second] + B, p.second.second}); } } for (int i = 0; i < N; i++) { cout << tree.size(i) << endl; } return 0; }