There is a class of students, numbered through n - 1. Every day the teacher of the class has some projects for the students. Each project has to be completed by a team of students within the same day. The projects may have various difficulty. For each project, the teacher knows the exact size of a team that should work on it.
Different students may prefer different team sizes. More precisely, student can only be assigned to a team of size between a_i and b_i inclusive. On each day, a student may be assigned to at most one team. Some students might not be assigned to any teams. Each team will work on a single project.
The teacher has already chosen the projects for each of the next days. For each of these days, determine whether it is possible to assign students to teams so that there is one team working on each project.
Suppose there are n = 4 students and q = 2 days. The students' constraints on team sizes aregiven in the table below.

On the first day there are m = 2 projects. The required team sizes are k_0 = 1 and k_1 = 3. These two teams can be formed by assigning student to a team of size and the remaining three students to a team of size .
On the second day there are m = 2 projects again, but this time the required team sizes are k_0 = 1 and k_1 = 1. In this case it is not possible to form the teams, as there is only one student who can be in a team of size .
You are given the description of all students: , and as well as a sequence of queries - one about each day. Each question consists of the number of projects on that day and a sequence of length containing the required team sizes. The sum of across all queries will be equal to (not given in the input, s \leq 200000). For each question, your program must return whether it is possible to form all the teams.
First line contains the number (1 \leq n \leq 500000) of students. Each of the next lines contains a pair of space-separated integers a_i and b_i (1 \leq a_i, b_i \leq n), where a_i is the minimum team size for student and b_i is the maximum team size for student . Next line contains the number of queries (1 \leq q \leq 200000) to follow. Each of the next lines consists of a query in the format , k_0, k_1, ..., k_{m-1}. (1 \leq m \leq n) represents the number of projects for this day and is an array of length containing the required team size for each of these projects. It is known that 1 \leq k_i \leq n. Note that the sum of all k_i may exceed .
For each query output a separate line containing either if it is possible to form all the required teams, or otherwise.
Example 1