In a certain organization, there are employees. Employee is considered a subordinate of employee if:
is a direct subordinate of , or
There exists an employee such that is a direct subordinate of , and is a subordinate of .
No employee is their own subordinate. Messages in the organization may be passed between and only if is a subordinate of or vice versa. The structure of the organization is such that messages can be passed between any two employees. For given employees and , determine whether is a subordinate of , is a subordinate of , or there is no subordinate relationship between them.
The first line contains the number of employees and the number of queries .
The second and third lines contain the query parameters , , and , , .
Then lines follow describing the organization's structure. The (i+3)-rd line contains information about the direct subordinates of the -th employee: k_i — the number of direct subordinates, followed by the indices of these k_i direct subordinates.
Employees are numbered from to n-1.
Each query is of the form (x_j, y_j), and the answer for each query should be if y_j is a subordinate of x_j, if x_j is a subordinate of y_j, or otherwise.
Here,
where j = 1..q-1, and \mathrm{sum}_{j-1} is the sum of the answers (moduli) to the first j-1 queries.
Constraints
1 \leq n \leq 10^5
1 \leq q \leq 5 \cdot 10^5
0 \leq X, a, b, Y, c, d < n

n - 1 \leq k_i < n + 100
For each query, print the answer in a separate line as described above.
Example 1