N, L, R = map(int, input().split()) deleted = [0 for _ in range(2501)] for i in range(L + 500): deleted[i] = 1 for i in range(R + 501, 2501): deleted[i] = 1 enemy = [[None for j in range(2501)] for i in range(2681)] for k in range(N): l, u, r, d = map(lambda x: int(x) + 500, input().split()) for i in range(u, d + 1): for j in range(l, r + 1): enemy[i][j] = k res = [0 for _ in range(N)] for i in range(2681)[::-1]: for j in range(2501): if not deleted[j] and enemy[i][j] is not None: deleted[j] = 1 res[enemy[i][j]] = 1 print(*res, sep='\n')