import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[][]d = new int[1681][1281]; int N = scan.nextInt(); int xLB = scan.nextInt(); int xRB = scan.nextInt(); for(int i = 0; i < N; i++) { int XL = scan.nextInt(); int YU = scan.nextInt(); int XR = scan.nextInt(); int YD = scan.nextInt(); int id = i + 1; int wMin = Math.max(0, XL); int hMin = Math.max(0, YU); int wMax = Math.min(1280, XR); int hMax = Math.min(1680, YD); for(int h = hMin; h <= hMax; h++) { for(int w = wMin; w <= wMax; w++) { d[h][w] = id; } } } scan.close(); int[]ans = new int[N]; for(int i = xLB; i <= xRB; i++) { for(int j = 1680; j >= 0; j--) { if(d[j][i] != 0) { ans[d[j][i] - 1] = 1; break; } } } for(int i : ans) { System.out.println(i); } } }