#include using namespace std; using block = tuple; int main() { int n, xlb, xrb; cin >> n >> xlb >> xrb; vector b(n); for (int i = 0; i < n; i++) { int xl, yu, xr, yd; cin >> xl >> yu >> xr >> yd; xl = max(xl, xlb); xr = min(xr, xrb); xl -= xlb; xr -= xlb; b.at(i) = make_tuple(-yd, xl, xr, i); } sort(b.begin(), b.end()); vector h(n, false), beam(xrb - xlb + 1, true); for (int i = 0; i < n; i++) { auto [_, xl, xr, idx] = b.at(i); for (int j = xl; j <= xr; j++) { if (beam.at(j)) { h.at(idx) = true; beam.at(j) = false; } } } for (int i = 0; i < n; i++) { cout << h.at(i) << endl; } }