#include #include #include using namespace std; int main(){ int N, A, B; while(cin >> N >> A >> B){ vector x(N); for(int i=0;i> x[i]; auto getIdx = [&](int val){ int L = -1, R = N; while(R-L > 1){ int mid = (L+R)/2; if(x[mid] < val) L = mid; else R = mid; } return R; }; vector res(N, 0); vector visit(N, -1); for(int i=0;i qu; qu.push(i); vector set; visit[i] = i; while(!qu.empty()){ int p = qu.front(); qu.pop(); set.push_back(p); int ms = getIdx(x[p]-B), me = getIdx(x[p]-A+1); int ps = getIdx(x[p]+A), pe = getIdx(x[p]+B+1); for(int j=ms;j=ms;j--){ if(visit[j] != -1) break; visit[j] = i; qu.push(j); } for(int j=ps;j=ps;j--){ if(visit[j] != -1) break; visit[j] = i; qu.push(j); } } for(auto& t : set) res[t] = set.size(); } for(auto& t : res) cout << t << endl; } }