def main(): N, xlb, xrb = map(int, input().split()) XL = [0] * N YU = [0] * N XR = [0] * N YD = [0] * N for i in range(N): XL[i], YU[i], XR[i], YD[i] = map(int, input().split()) d = [float('inf')] * (xrb + 1) for x in range(xlb, xrb + 1): for i in range(N): if XL[i] <= x <= XR[i]: d[x] = min(d[x],i) ans = [0] * N for x in range(xlb, xrb + 1): if d[x] != float('inf'): ans[d[x]] = 1 for i in range(N): print(ans[i]) if __name__ == "__main__": main()