N,L,R = map(int,input().split()) INF = float('INF') ls = [-1]*(1681) ll = [] for i in range(N): ll.append(list(map(int,input().split()))+[i]) ll.sort(key=lambda x:x[1]) for i in range(N): xl,yu,xr,yd,ind = ll[i] for j in range(xl,xr+1): ls[j] = ind la = [0]*N for i in range(L,R+1): if ls[i] == -1: continue la[ls[i]] = 1 print(*la,sep='\n')