Time limit
2s
Memory limit
128 MB
You need to divide n students into a blue team and a white team. Some students do not want to be on the same team as certain other students.
Given each student's dislike list, write a program that divides all students into two teams so that no two students who dislike each other are placed on the same team.
The first line contains the number of students n. (1 ≤ n ≤ 100)
The next n lines describe the students each person dislikes. The i-th of these lines contains the number of students disliked by student i, followed by their student numbers separated by spaces.
The case where every student dislikes no one is not given.
On the first line, print the number of students on the blue team.
On the second line, print the blue team members in increasing order.
On the third line, print the number of students on the white team.
On the fourth line, print the white team members in increasing order.
If there are multiple valid answers, print any one of them.