Time limit
2s
Memory limit
128 MB
There are N stones and some unordered pairs of stones that can pass to each other. Not every pair of stones can pass.
Each stone must be assigned to exactly one of two groups: attack or defense. A stone satisfies the condition if the number of stones in the same group that it can directly pass to is even.
It is possible to divide the stones so that every stone satisfies this condition. Find one such division and print the numbers of the stones in either one of the two groups.
The first line contains the number of stones N (1 ≤ N ≤ 200).
For each i from 1 to N, the next line starts with L_i, the number of stones that stone i can pass to, followed by the L_i stone numbers.
No stone can pass to itself. If stone A can pass to stone B, then stone B can also pass to stone A.
On the first line, print M, the number of stones in one of the two groups.
On the second line, print the M stone numbers in that group, separated by spaces. If M = 0, leave the second line empty. Stones not printed are considered to be in the other group.
If there are multiple valid answers, print any one of them.