PROGRAMMING:Router
Rapid information transmission has become a must. The work of information transmission is realized by the router on the network node. Each router maintains a "router table" giving the number of routers it can reach directly. It is obvious that information transmission requires the least number of routers (also known as "hops"). For the given network, it is required to write a program to find the best route (minimum hops) from the information source to the target node. Suppose that n routers are numbered from 0 to n-1, the number of routers in the network is not more than 200, and there are at least 2 routers, and each router is directly connected to at most 50 routers.
###Input format:
The input contains multiple sets of test data. Each group of data input first line integer n and m, which represents the number of routers in the network. The next N lines represent the list of router IDs that can be directly reached by each router. Each line is a set of integer spaces, in the format of $$I $$$$k $$$v_{ 1}$$ $$v_{ 2}$$ ... $$v_{ k} $$, where $$I $$represents the router number, $$k $$is the number of routers that router I can directly reach, and the next number of $$k $$is $$v_{ 1}$$ $$v_{ 2}$$ ... $$v_{ k} $$indicates the router number that router I can directly reach. Next, M rows represent m groups of queries, and each row contains two integers a and B, representing the number of the starting router and the ending router.
Tip: EOF can be used to judge the end of input
###Output format:
For each group of test data, output m lines, the minimum number of hops for each behavior information to be transmitted from router a to router B. if it is impossible to transmit information (the starting router and the ending router are not connected), output "connection impossible".
###Input example:
```in
6 2
0 5 1 2 3 4 5
1 0
2 0
3 0
4 0
5 0
0 2
1 2
4 2
0 2 1 2
1 2 2 3
2 1 3
3 1 2
0 3
1 0
```
###Output example:
```out
one
connection impossible
two
connection impossible
```
answer:If there is no answer, please comment
###Input format:
The input contains multiple sets of test data. Each group of data input first line integer n and m, which represents the number of routers in the network. The next N lines represent the list of router IDs that can be directly reached by each router. Each line is a set of integer spaces, in the format of $$I $$$$k $$$v_{ 1}$$ $$v_{ 2}$$ ... $$v_{ k} $$, where $$I $$represents the router number, $$k $$is the number of routers that router I can directly reach, and the next number of $$k $$is $$v_{ 1}$$ $$v_{ 2}$$ ... $$v_{ k} $$indicates the router number that router I can directly reach. Next, M rows represent m groups of queries, and each row contains two integers a and B, representing the number of the starting router and the ending router.
Tip: EOF can be used to judge the end of input
###Output format:
For each group of test data, output m lines, the minimum number of hops for each behavior information to be transmitted from router a to router B. if it is impossible to transmit information (the starting router and the ending router are not connected), output "connection impossible".
###Input example:
```in
6 2
0 5 1 2 3 4 5
1 0
2 0
3 0
4 0
5 0
0 2
1 2
4 2
0 2 1 2
1 2 2 3
2 1 3
3 1 2
0 3
1 0
```
###Output example:
```out
one
connection impossible
two
connection impossible
```
answer:If there is no answer, please comment