if __name__ == "__main__": n, lb, lr = tuple(map(int, input().split(" "))) enemy_list = [] ans_list = [] laser_range = [False for i in range(1281)] for i in range(lb, lr + 1): laser_range[i] = True for i in range(n): enemy_list.append((i,) + tuple(map(int, input().split(" ")))) enemy_list = sorted(enemy_list, key=lambda x: x[4]) enemy_list.reverse() for enemy in enemy_list: xl = max(enemy[1], 0) xr = min(enemy[3], 1280) yu = min(enemy[2], 0) yd = enemy[4] is_die = False for i in range(xl, xr + 1): if laser_range[i]: laser_range[i] = False is_die = True ans_list.append((enemy[0], is_die)) ans_list = sorted(ans_list, key=lambda x: x[0]) for ans in ans_list: if ans[1]: print(1) else: print(0)