import bisect class UnionFind: def __init__(self, n): self.par = [i for i in range(n+1)] self.rank = [0] * (n+1) self.size = [1 for _ in range(n+1)] # 検索 def find(self, x): if self.par[x] == x: return x else: self.par[x] = self.find(self.par[x]) return self.par[x] # 併合 def union(self, x, y): x = self.find(x) y = self.find(y) if self.rank[x] < self.rank[y]: self.par[x] = y self.size[y] += self.size[x] else: self.par[y] = x self.size[x] += self.size[y] if self.rank[x] == self.rank[y]: self.rank[x] += 1 # 同じ集合に属するか判定 def same_check(self, x, y): return self.find(x) == self.find(y) n,a,b = map(int,input().split()) x = [int(i) for i in input().split()] ki = UnionFind(n+1) idx = [0]*n for i in range(n): ia = bisect.bisect_left(x,x[i]+a) ib = bisect.bisect_right(x,x[i]+b) #print(i,ia,"srt") ix = ia for j in range(ib-ia): if ix >= ib: break if not ki.same_check(i,ix): ki.union(i,ix) idx[ki.find(i)] = max(ix,idx[ki.find(i)]) ix += 1 else: ix = idx[ki.find(i)] #print(i,ia+j) #ki.union(1,5) li = [0]*n num = [0]*n for i in range(n): tmp = ki.find(i) li[i] = tmp num[tmp] += 1 #print(ki.find(i),"find") for i in range(n): print(num[li[i]])