#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <stack>

#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define REP(i,a,n) for(int i = (a);i < (n);i++)
#define PI 3.14159265359
#define MOD 1000007
#define chmax(a,b) if(a < b)a = b

using namespace std;

int main(){
    int n,lb,rb;
    cin >> n >> lb >> rb;
    vector<pair<int, int>> a(1280);
    REP(i, 0, n){
        int xl,yl,xr,yr;
        cin >> xl >> yl >> xr >> yr;
        xl--;
        xl = xl < 0 ? 0 : xl;
        xr--;
        xr = xr > 1279 ? 1279 : xr;
        for(int j = max(xl,lb-1);j <= min(xr,rb-1);j++){
            if(a[j].second < yl){
                a[j].first = i+1;
                a[j].second = yl;
            }
        }
    }
    sort(ALL(a));
    REP(i, 1, n+1){
        int ans = 0;
        REP(j, 0, a.size()){
            if(a[j].first == i){
                ans = 1;
                break;
            }
            else if(a[i].first > n){
                break;
            }
        }
        cout << ans << endl;
    }
    return 0;
}