F = [[0 for _ in range(1280)] for _ in range(1680)] n, l, r = map(int, input().split()) for idx in range(n): xl, yu, xr, yd = map(int, input().split()) for i in range(max(0, yu - 1), min(1680, yd)): for j in range(max(0, xl - 1), min(1280, xr)): F[i][j] = idx + 1 ANS = [0 for _ in range(n)] for j in range(1280): for i in range(1679, -1, -1): if F[i][j] != 0: ANS[F[i][j] - 1] = 1 break print(*ANS, sep='\n')