using System; using System.Collections.Generic; using System.Linq; namespace y { class Program { static void Main(string[] args) { var ss = Console.ReadLine().Split(); int n = int.Parse(ss[0]); int lb = int.Parse(ss[1]); int rb = int.Parse(ss[2]); var m = new int[1280, 1680]; for (int i = 1; i <= n; i++) { ss = Console.ReadLine().Split(); var xl = int.Parse(ss[0]); var yu = int.Parse(ss[1]); var xr = int.Parse(ss[2]); var yd = int.Parse(ss[3]); if (xl < 0) xl = 1; if (xr > 1280) xr = 1280; if (yu < 0) yu = 1; if (yd > 1679) yd = 1680; for (int j = xl - 1; j <= xr - 1; j++) { for (int k = yu - 1; k <= yd - 1; k++) { m[j, k] = i; } } } var ans = new List(); for (int i = lb -1; i < rb - 1; i++) { for (int j = 1679; j >= 1; j--) { if (m[i, j] != 0) { ans.Add(m[i, j]); break; } } } for (int i = 1; i <= n; i++) { Console.WriteLine(ans.Contains(i) ? 1 : 0); } Console.ReadLine(); } } }