#include using namespace std; class DisjointSet { private: class Node { friend DisjointSet; std::size_t parent; std::size_t size; std::size_t left = 0, right = 0; Node(const std::size_t parent, const std::size_t size) : parent(parent), size(size) {} }; std::vector nodes; public: explicit DisjointSet(const std::size_t n) : nodes(n, Node(n, 1)) { for (std::size_t i = 0; i < n; i++) { nodes[i].left = nodes[i].right = i; } } std::size_t size() const { return nodes.size(); } std::size_t size(const std::size_t x) { return nodes[root(x)].size; } std::size_t root(const std::size_t x) { if (nodes[x].parent == size()) return x; return nodes[x].parent = root(nodes[x].parent); } std::size_t left(const std::size_t x) { return nodes[root(x)].left; } std::size_t right(const std::size_t x) { return nodes[root(x)].right; } bool is_same(const std::size_t x, const std::size_t y) { return root(x) == root(y); } bool unite(const std::size_t x, const std::size_t y) { std::size_t rx = root(x), ry = root(y); if (rx == ry) return false; if (nodes[rx].size < nodes[ry].size) std::swap(rx, ry); nodes[rx].left = std::min(nodes[rx].left, nodes[ry].left); nodes[rx].right = std::max(nodes[rx].right, nodes[ry].right); nodes[rx].size += nodes[ry].size; nodes[ry].parent = rx; return true; } void unite_range(const std::size_t x, const std::size_t y) { if (x > y) return; while (right(x) < y) { unite(right(x), right(x) + 1); } } }; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N, A, B; cin >> N >> A >> B; vector X(N); for (auto &&e : X) { cin >> e; } DisjointSet ds(N); for (int i = 0; i < N; i++) { int a = lower_bound(X.begin(), X.end(), X[i] + A) - X.begin(); int b = min(N - 1, static_cast(upper_bound(X.begin(), X.end(), X[i] + B) - X.begin() - 1)); ds.unite_range(a, b); if (a <= b) ds.unite(i, a); } for (int i = 0; i < N; i++) { cout << ds.size(i) << '\n'; } return 0; }