n, xlb, xrb = map(int, input().split()) s = [] for i in range(n): xl, _, xr, yu = map(int, input().split()) s.append([i+1, yu, xl, xr]) s = sorted(s, key=lambda x:(-x[1], x[0])) l = [99 for _ in range(1281)] for i in range(xlb, xrb+1): l[i] = 0 ans = [] for i in s: if i[2] < 0: i[2] = 0 if i[3] > 1280: i[3] = 1280 for j in range(i[2], i[3]+1): if l[j-1] == 0: ans.append(i[0]) l[j-1] = i[0] print(l) ans = list(set(ans)) for i in range(1, n+1): if i in ans: print(1) else: print(0)