Problem G

Good Fr[i]ends

There are n people in a class. Some of them are good friends. They go out frequently. Given m activities, find out which people are good friends.

In this problem, if a set of at least two people attended in at least 20% activities together (possibly with some other people), they're regarded as good friends.

Note that "good friends" should be maximal. That means, if you add another person to the set, they will not be "good friends" anymore.

Input

The first line contains the number of test cases T(T<=5). Each test case begins with two integers n, m (2<=n<=30, 5<=m<=10,000), the number of people in the class, and the number of activities. Each of the m lines begins with an integer k (2<=k<=n), the number of people attending the activity, then k different integers (1~n) followed. People are numbered 1 to n.

Output

For each test case, print the number of "good friends" sets in the first line, and then print one line for each set. The numbers in each set should be sorted in increasing order. Sets should be sorted in lexicographical order. Print a blank line after each test case.

Sample Input

1
10 10
7 1 2 3 4 5 6 7
7 2 4 5 6 7 9 10
8 1 2 4 5 6 7 9 10
6 2 5 6 7 8 10
6 1 3 4 6 9 10
8 1 2 4 5 6 7 9 10
6 1 2 3 5 6 7
6 2 5 6 7 8 10
7 2 5 6 7 8 9 10
8 2 3 4 5 6 7 9 10

Output for the Sample Input

Case 1: 6
1 2 3 5 6 7
1 2 4 5 6 7 9 10
1 3 4 6
2 3 4 5 6 7
2 5 6 7 8 10
3 4 6 9 10

Data Generation

Judge inputs are generated randomly this way:

Bonus

Be sure to test your program with the data provided in our gift package.


Rujia Liu's Present 6: Happy 30th Birthday to Myself
Special thanks: Yubin Wang, Yao Li