#include <bits/stdc++.h> #define show(x) cerr << #x << " = " << x << endl using namespace std; using ll = long long; using ld = long double; constexpr ll MOD = 1000000007LL; template <typename T> constexpr T INF = numeric_limits<T>::max() / 10; template <typename Functor> struct fix_type { Functor functor; template <typename... Args> decltype(auto) operator()(Args&&... args) const& { return functor(functor, std::forward<Args>(args)...); } }; template <typename Functor> fix_type<typename std::decay<Functor>::type> fix(Functor&& functor) { return {std::forward<Functor>(functor)}; } struct Ship { int xl; int xr; int yd; int yu; }; int main() { int N; cin >> N; int L, R; cin >> L >> R; vector<Ship> ship(N); for (int i = 0; i < N; i++) { Ship& s = ship[i]; cin >> s.xl >> s.yu >> s.xr >> s.yd; } vector<bool> hit(N, false); for (int x = L; x <= R; x++) { int minind = -1; int Y = -501; for (int i = 0; i < N; i++) { if (ship[i].xl <= x and x <= ship[i].xr) { if (Y < ship[i].yd) { Y = ship[i].yd; minind = i; } } } if (minind != -1) { hit[minind] = true; } } for (int i = 0; i < N; i++) { cout << hit[i] << endl; } return 0; }