Printer Bajtazar has received an order to print a text-based tablet. The letters on the tablet are arranged uniformly on an $n \times m$ grid. Bajtazar will perform the printing using a printing template, which is a strip with a width equal to the width of one row of letters. The printing is done by (potentially multiple) applications of the template and spraying paint exactly over the template, with the constraint that at the moment of printing, the template cannot extend beyond the tablet.
The template will be prepared in a horizontal and a vertical version, and both versions must contain the same text. Bajtazar must print each position on the tablet exactly once using the template. Note that neither version of the template can be rotated, so that the letters are not printed in an inverted manner.
Help Bajtazar and provide all template lengths with which Bajtazar can print the entire tablet.
Input
The first line of input contains two positive integers $n$ and $m$, representing the number of rows of letters on the tablet and the number of letters in each row of the tablet, respectively. The $i$-th of the following $n$ lines contains an $m$-letter string consisting of lowercase English letters (a–z), representing the target content of the $i$-th row of the tablet from the top.
Output
The first line of output should contain a single integer representing the number of template lengths with which Bajtazar can print the tablet. The second line should contain all these lengths, ordered strictly increasingly, separated by single spaces. If the first line of output contains the number 0, the second line should remain empty.
Examples
Input 1
5 8 aabaaaaa babaabbb aabaaaaa aabaaaaa abaaabaa
Output 1
1 4
Subtasks
The test suite is divided into the following subtasks. Tests for each subtask consist of one or more separate test groups.
| Subtask | Constraints | Points |
|---|---|---|
| 1 | $n = 1, m \le 1000$ | 10 |
| 2 | $n \le 3, m \le 1000$ | 25 |
| 3 | $n, m \le 20$ | 20 |
| 4 | $n, m \le 1000$ | 45 |