#include using namespace std; #define ll long long struct enem { int id; int xl; int yu; int xr; int yd; bool operator<( const enem& r) const { return yd < r.yd; } }; int main() { int n, xlb, xrb; cin >> n >> xlb >> xrb; vector es; int who[1281] = {}; for(int id=1; id<=n; id++) { int xl, yu, xr, yd; cin >> xl >> yu >> xr >> yd; enem e; e.id = id; e.xl = xl; e.yu = yu; e.xr = xr; e.yd = yd; es.push_back(e); } sort(es.begin(), es.end()); for(auto e : es) { int xl = e.xl; int xr = e.xr; for(int x=max(1, xl); x<=min(xr, 1280); x++) { who[x] = e.id; } } set s; for(int x=1; x<=1280; x++) { s.insert(who[x]); } for(int id=1; id<=n; id++) { if(s.find(id) != s.end()) { cout << 1 << endl; } else { cout << 0 << endl; } } // for (auto x: s) { // cout << x; // } // cout << endl; return 0; }