Problem BB
Firetrucks Are Red

Alice lives in house number 25 on her street, but that is exactly Bob’s age. Bob is born on June 4th, and Charlie was his parents’ fourth child. Finally, Diane has five fingers on her left hand, which happens to be the same as the number of toes that Bob has on his right foot!
This shows that her friends are all connected—either directly or indirectly—by numbers. But she still has to convince her family as well as her coworkers.
Given a group of
Input
The input consists of:
-
One line with an integer
( ), the number of individuals in the group. The individuals are numbered from to . -
lines, describing the individuals in the group.The
th such line starts with an integer ( ), the number of numbers that describe individual .The remainder of the line has
distinct integers ( for each ), the set of numbers that describe individual .
It is guaranteed that the sum over all
Output
Output a proof in the form of
If no such proof exists, output “impossible”. If there are multiple proofs, you may output any one of them.
Sample Input 1 | Sample Output 1 |
---|---|
6 2 17 10 1 5 2 10 22 3 17 22 9 2 17 8 3 9 22 16 |
impossible |
Sample Input 2 | Sample Output 2 |
---|---|
6 2 17 10 2 5 10 2 10 22 3 17 22 9 2 17 8 3 9 22 16 |
1 3 10 2 3 10 3 4 22 4 5 17 4 6 9 |