#include using namespace std; #define REP(i,a,n) for(int i=(a); i<(int)(n); i++) #define rep(i,n) REP(i,0,n) #define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it) #define ALLOF(c) (c).begin(), (c).end() typedef long long ll; typedef unsigned long long ull; struct ST { int l,u,r,d; }; bool operator<(const ST& a, const ST& b){ return a.d > b.d; } int main(){ int N, xLB, xRB; cin >> N >> xLB >> xRB; vector v; rep(i,N){ int l, u, r, d; cin >> l >> u >> r >> d; v.push_back((ST){l,u,r,d}); } sort(ALLOF(v)); vector field(5000, -1); rep(i,v.size()){ int l = v[i].l; int r = v[i].r; REP(x,l,r+1){ if(x<0) continue; if(field[x] != -1) continue; field[x] = i; } } vector ret(N, 0); REP(x,xLB,xRB+1){ if(field[x] == -1) continue; ret[field[x]] = 1; } rep(i,ret.size()){ cout << ret[i] << endl; } return 0; }