#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <queue>

void solve() {
    int n, a, b;
    std::cin >> n >> a >> b;

    std::set<int> xs;
    std::map<int, int> xrev;
    for (int i = 0; i < n; ++i) {
        int x;
        std::cin >> x;
        xs.insert(x);
        xrev[x] = i;
    }

    std::vector<int> ans(n, -1);

    while (!xs.empty()) {
        std::vector<int> g;

        std::queue<int> que;
        que.push(*xs.begin());
        xs.erase(xs.begin());

        while (!que.empty()) {
            int x = que.front();
            que.pop();
            g.push_back(x);

            {
                int l = x - b, r = x - a;
                auto it = xs.lower_bound(l);
                while (it != xs.end() && *it <= r) {
                    que.push(*it);
                    it = xs.erase(it);
                }
            }

            {
                int l = x + a, r = x + b;
                auto it = xs.lower_bound(l);
                while (it != xs.end() && *it <= r) {
                    que.push(*it);
                    it = xs.erase(it);
                }
            }
        }

        for (auto x : g) {
            ans[xrev[x]] = g.size();
        }
    }

    for (auto a : ans) std::cout << a << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}