N,l,r = map(int, input().split()) L = [[int(l) for l in input().split()] for _ in range(N)] for i in range(N): L[i].append(i) from operator import itemgetter L.sort(reverse = True, key = itemgetter(1)) B = [0]*1281 ans = [0]*N for i in range(l, r+1): B[i] = 1 for t in L: for i in range(t[0], t[2]+1): if B[i] == 1: ans[t[4]] = 1 B[i] = 0 for a in ans: print(a)