#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){ ST st; cin >> st.l >> st.u >> st.r >> st.d; v.push_back(st); } sort(ALLOF(v)); vector field(5000, -1); rep(i,v.size()){ for(int x=v[i].l; x<=v[i].r; x++){ if(x<0) continue; if(field[x] != -1) continue; field[x] = i; } } vector ret(N, 0); for(int x=xLB; x<=xRB; x++){ if(field[x] == -1) continue; ret[field[x]] = 1; } rep(i,ret.size()){ cout << ret[i] << endl; } return 0; }