Gats and the Loose Thread
Gats has a shelf of colored yarn, written as a string . He also has a favorite tidy pattern, written as a string .
By pulling out exactly one loose thread from a consecutive part of the shelf, Gats wants that part to become exactly the tidy pattern.
Both strings are indexed from . The shelf string has length , and the pattern string has length .
For each starting position with , Gats looks at the consecutive block
of length .
The position is called tidy if there exists an integer with such that deleting the -th character from leaves exactly .
If several values of work for the same , that position is still counted once.
Find every tidy starting position.
Input
The first line contains two integers and (, ), the lengths of and .
Output
Let be the number of tidy starting positions.
Print on the first line.
If , print a second line containing the tidy positions in increasing order. No second line is required when .
Samples
Sample 1
Input
7 3 abxcabc abc
Output
2 1 4
The tidy positions are and . At position , the block is abxc, and deleting its third character yields abc. At position , the block is cabc, and deleting its first character yields abc.
Sample 2
Input
5 2 aaaaa aa
Output
3 1 2 3
Each block of length is aaa, which becomes aa after deleting one character. Although several deletions are possible, each starting position is reported once.