Background
A rare case of laziness and procrastination has broken out in JSOI. To save his friends from this plight, JYY has collected the DNA sequences of all viruses in the JSOI kingdom and hopes to classify these DNA sequences to conduct in-depth analysis and find a cure for the procrastination.
Problem Statement
There are $N$ different types of viruses in the JSOI kingdom, and the DNA sequence of each virus is represented by a sequence of uppercase letters.
JYY wants to divide these viruses into the minimum possible number of categories, such that each virus belongs to exactly one category.
Viruses in the same category must satisfy at least one of the following two properties:
- The "$k$-prefix" (the first $k$ uppercase letters) of all DNA sequences in the same category are identical;
- The "$k$-suffix" (the last $k$ uppercase letters) of all DNA sequences in the same category are identical.
JYY wants to find a classification scheme that satisfies these requirements and minimizes the total number of categories.
Input
The first line contains two positive integers $N$ and $k$.
The next $N$ lines each contain a string $S_i$, representing the DNA sequence of the $i$-th virus. It is guaranteed that the length of $S_i$ is at least $k$.
Output
The first line contains an integer $C$, representing the minimum number of categories.
The next $C$ lines each start with a positive integer $w$, representing the number of viruses in the current category, followed by $w$ positive integers representing the indices of the viruses belonging to that category.
If there are multiple optimal solutions, you may output any one of them.
Scoring
For each test case, if the first line contains the correct positive integer $C$, you will receive 5 points.
If, given that the first line is correct, the following $C$ lines describe a valid optimal solution, you will receive 10 points.
Otherwise, you will receive 0 points.
Examples
Input 1
4 1 A AB BB BA
Output 1
2 2 1 2 2 3 4
Note 1
The sample output receives 10 points.
Constraints
For $20\%$ of the data, $N \le 10$.
For $40\%$ of the data, $N \le 500$.
For $100\%$ of the data, $N \le 5\,000$, $k \le 550$.