N, L, R = map(int, input().split()) maxv = [-1] * 2005 ans = [-1] * 2005 for i in range(N): xL, yU, xR, yD = map(int, input().split()) xL = max(0, xL) for j in range(xL, xR + 1): if yD > maxv[j]: maxv[j] = yD ans[j] = i S = set() for i in range(L, R + 1): S.add(ans[i]) for i in range(N): if i in S: print(1) else: print(0)