#include #include #include using namespace std; struct enemy { int XL, XR, YD, ans, order; }; bool compYD(const enemy &x, const enemy &y) { return x.YD > y.YD; } bool compOrder(const enemy &x, const enemy &y) { return x.order < y.order; } int main() { int N, xLB, xRB, width[1280] = {}, j; enemy hitJudge[188]; cin >> N >> xLB >> xRB; for (int i = xLB; i <= xRB; ++i) width[i - 1] = 1; for (int i = 0; i < N; ++i) { scanf("%d%*d%d%d", &hitJudge[i].XL, &hitJudge[i].XR, &hitJudge[i].YD); if (hitJudge[i].XL < 1) hitJudge[i].XL = 1; if (hitJudge[i].XR > 1280) hitJudge[i].XR = 1280; hitJudge[i].order = i; } sort(hitJudge, hitJudge + N, compYD); for (int i = 0; i < N; ++i) { for (j = hitJudge[i].XL; j <= hitJudge[i].XR; ++j) { if (width[j - 1] == 1) break; } if (j != hitJudge[i].XR + 1) { for (j = hitJudge[i].XL; j <= hitJudge[i].XR; ++j) width[j - 1] = 0; hitJudge[i].ans = 1; } else hitJudge[i].ans = 0; } sort(hitJudge, hitJudge + N, compOrder); for (int i = 0; i < N; ++i) cout << hitJudge[i].ans << endl; }