import sys input = sys.stdin.buffer.readline sys.setrecursionlimit(10 ** 7) N, L, R = map(int, input().split()) pixel = [-1] * (1280 + 1) height = [-1] * N for i in range(N): xl, _, xr, y = map(int, input().split()) xl = max(0, xl) xr = min(1280, xr) height[i] = y for j in range(xl, xr + 1): if pixel[j] == -1: pixel[j] = i elif height[pixel[j]] < y: pixel[j] = i ans = [0] * N for i in range(L, R+1): p = pixel[i] if p == -1: continue ans[p] = 1 print(*ans, sep="\n")