#include using namespace std; #define DEBUG(x) cout<<#x<<": "< #define vl vector #define vii vector< vector > #define vll vector< vector > #define vs vector #define pii pair #define pis pair #define psi pair #define pll pair #define fi first #define se second #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) #define all(c) c.begin(),c.end() #define in(x, a, b) a <= x && x < b const int inf = 1000000001; const ll INF = 2e18; const ll MOD = 1000000007; //const ll mod = 1000000009; const double pi = 3.14159265358979323846; #define Sp(p) cout<> n >> x0 >> x1; vii gamen(1680, vi(1280, -1)); rep (i, n) { int xl, yu, xr, yd; cin >> xl >> yu >> xr >> yd; xl--; yu--; xr--; yd--; xl = max(xl, 0); yu = max(yu, 0); xr = min(xr, 1279); yd = min(yd, 1679); for (int j = xl; j <= xr; j++) { for (int k = yu; k <= yd; k++) { gamen[k][j] = i; } } } vector enemy(n, true); vector beam(1280, true); for (int i = 1679; i >= 0; i--) { for (int j = 0; j < 1280; j++) { if (gamen[i][j] != -1 && beam[j]) { enemy[gamen[i][j]] = false; beam[j] = false; } } } rep (i, n) { cout << (int)!enemy[i] << endl; } }