import bisect from collections import deque from sortedcontainers import SortedSet N,A,B=map(int,input().split()) x=list(map(int,input().split())) x.sort() ne=[-1]*N def root(N): if ne[N]<0: return N else: ne[N]=root(ne[N]) return ne[N] def merge(x,y): x,y=root(x),root(y) if x==y: return if ne[x]>ne[y]: x,y=y,x ne[x]+=ne[y] ne[y]=x def same(x,y): return root(x)==root(y) q=deque() stp=set() n={v:i for i,v in enumerate(x)} x=SortedSet(x) haiki=[] while x: now=x.pop(0) q.append(now) haiki=[] while q: now=q.popleft() a=x.bisect_right(now-A) b=x.bisect_left(now-B) c=x.bisect_left(now+A) d=x.bisect_right(now+B) for v in range(b,a): if same(n[now],n[x[v]]): continue haiki.append(x[v]) merge(n[now],n[x[v]]) q.append(x[v]) for v in range(c,d): if same(n[now],n[x[v]]): continue haiki.append(x[v]) merge(n[now],n[x[v]]) q.append(x[v]) while haiki: x.discard(haiki.pop()) for i in range(N): print(-ne[root(i)])