#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define repi(i,a,b) for(int i=(int)(a);i<(int)(b);i++) #define all(x) (x).begin(),(x).end() #define foreach(u,v) for(auto (u) : (v)) #define pb push_back #define mp make_pair #define mt make_tuple typedef long long ll; typedef pair pii; typedef vector vi; typedef vector vvi; typedef pair pll; typedef vector vl; const int inf = 1e9; const ll linf = 1LL<<60; const ll mod = 1e9 + 7; const double eps = 1e-9; /* */ int main() { int n, l, r; cin >> n >> l >> r; vector> v; rep(i, n){ int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2; v.pb(mt(y2, x1, x2, i)); } sort(all(v)); reverse(all(v)); vector flag(1281, true); vi ans(n, 0); foreach(u, v){ int y, x1, x2, i; tie(y, x1, x2, i) = u; printf("%d %d %d %d\n", y, x1, x2, i); if(x2 < l or r < x1) continue; if(x1 < l) x1 = l; if(x2 > r) x2 = r; bool f = false; repi(j, x1, x2+1){ if(flag[j]) f = true; } if(f){ ans[i] = 1; repi(j, x1, x2+1){ flag[j] = false; } } } rep(i, n) cout << ans[i] << endl; return 0; }