PROGRAMMING:tribe
In a community, everyone has their own small circle, and may belong to many different circles of friends at the same time. We think that friends of friends are all included in a tribe, so please count how many tribes do not intersect each other in a given community? And check whether any two people belong to the same tribe.
###Input format:
Input in the first line to give a positive integer $$n $$($$Le 10 ^ 4 $$), which is the number of known small circles. Next, $$n $$lines, each of which gives a small group of people in the following format:
$$K$$ $$P[1]$$ $$P[2]$$ $$\cdots$$ $$P[K]$$
Where $$k $$is the number of people in the small circle, $$p [i] $($$I = 1, cdots, K $$) is the number of everyone in the small circle. Here, everyone's number starts from 1, and the maximum number will not exceed $$10 ^ 4 $.
The next line gives a non negative integer, $$q $$($$Le 10 ^ 4 $$), which is the number of queries. Next, there are $$q $$lines, each of which gives the number of a pair of people to be queried.
###Output format:
First, output the total number of this community and the number of disjoint tribes in one line. Then for each query, if they belong to the same tribe, output 'y' in the same row, otherwise output 'n'.
###Input example:
```in
four
3 10 1 2
2 3 4
4 1 5 7 8
3 9 6 4
two
10 5
3 7
```
###Output example:
```out
10 2
Y
N
```
answer:If there is no answer, please comment
###Input format:
Input in the first line to give a positive integer $$n $$($$Le 10 ^ 4 $$), which is the number of known small circles. Next, $$n $$lines, each of which gives a small group of people in the following format:
$$K$$ $$P[1]$$ $$P[2]$$ $$\cdots$$ $$P[K]$$
Where $$k $$is the number of people in the small circle, $$p [i] $($$I = 1, cdots, K $$) is the number of everyone in the small circle. Here, everyone's number starts from 1, and the maximum number will not exceed $$10 ^ 4 $.
The next line gives a non negative integer, $$q $$($$Le 10 ^ 4 $$), which is the number of queries. Next, there are $$q $$lines, each of which gives the number of a pair of people to be queried.
###Output format:
First, output the total number of this community and the number of disjoint tribes in one line. Then for each query, if they belong to the same tribe, output 'y' in the same row, otherwise output 'n'.
###Input example:
```in
four
3 10 1 2
2 3 4
4 1 5 7 8
3 9 6 4
two
10 5
3 7
```
###Output example:
```out
10 2
Y
N
```
answer:If there is no answer, please comment