#define _USE_MATH_DEFINES #include "bits/stdc++.h" using namespace std; #define FOR(i,j,k) for(int (i)=(j);(i)<(int)(k);++(i)) #define rep(i,j) FOR(i,0,j) #define each(x,y) for(auto &(x):(y)) #define mp make_pair #define MT make_tuple #define all(x) (x).begin(),(x).end() #define debug(x) cout<<#x<<": "<<(x)< >(b,vector(c,d)) #define vvv(a,b,c,d,e) vector > >(b,vv(a,c,d,e)) using ll = long long; using pii = pair; using vi = vector; using vll = vector; int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(20); int N, xLB, xRB; while (cin >> N >> xLB >> xRB) { vi A(1281); map > > B; rep(a, N) { int xl, yu, xr, yd; cin >> xl >> yu >> xr >> yd; smax(xl, xLB); smin(xr, xRB); B[yd].emplace_back(xl, xr, a); } vi re(N); for (auto it = B.rbegin(); it != B.rend(); ++it) { int y = it->first; auto & p = it->second; if (y <= 0)break; each(q, p) { int xl, xr, k; tie(xl, xr, k) = q; FOR(a, xl, xr + 1)if (!A[a]) { re[k] = 1; FOR(b, xl, xr + 1)A[b] = 1; break; } } } rep(a, N)cout << re[a] << endl; } }