from bisect import bisect_left, bisect_right class UnionFind(): def __init__(self, n): self.n = n self.parents = [-1] * n self.left = [0] * n self.right = [0] * n for i in range(n): self.left[i] = i self.right[i] = i def find(self, x): if self.parents[x] < 0: return x else: self.parents[x] = self.find(self.parents[x]) return self.parents[x] def union(self, x, y): x = self.find(x) y = self.find(y) if x == y: return if self.parents[x] > self.parents[y]: x, y = y, x self.left[x] = min(self.left[x], self.left[y]) self.right[x] = max(self.right[x], self.right[y]) self.parents[x] += self.parents[y] self.parents[y] = x def findleft(self, x): x = self.find(x) return self.left[x] def findright(self, x): x = self.find(x) return self.right[x] def pair(self, x): x = self.find(x) return (self.left[x], self.right[x]) def union_range(self, a, b): if a >= b: return else: while self.findright(a) < b: self.union(self.findright(a), self.findright(a) + 1) def size(self, x): return -self.parents[self.find(x)] def same(self, x, y): return self.find(x) == self.find(y) def members(self, x): root = self.find(x) return [i for i in range(self.n) if self.find(i) == root] def roots(self): return [i for i, x in enumerate(self.parents) if x < 0] def group_count(self): return len(self.roots()) def all_group_members(self): return {r: self.members(r) for r in self.roots()} def __str__(self): return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots()) N, A, B = map(int,input().split()) X = list(map(int, input().split())) uf = UnionFind(N) for idx, i in enumerate(X): L_left = bisect_left(X, i-B) L_right = bisect_right(X, i-A) R_left = bisect_left(X, i+A) R_right = bisect_right(X, i+B) #print(L_left, L_right, R_left, R_right) if L_right - L_left > 0: uf.union(idx, L_left) uf.union_range(L_left, L_right-1) if R_right - R_left > 0: uf.union(idx, R_left) uf.union_range(R_left, R_right-1) for i in range(N): print(uf.size(i))