n,L,R = map(int,input().split()) DLR = [] for i in range(n): l,u,r,d = map(int,input().split()) DLR.append((d,l,r,i+1)) DLR.sort() res = [0]*19300 for d,l,r,i in DLR: for j in range(l,r+1): res[j] = i cnt = [0]*(n+1) for i in res: cnt[i] = 1 print(*cnt[1:],sep="\n")