Professor Zhang would like to solve the multiple pattern matching problem, but he only has only one pattern string $p=p_{1}p_{2}...p_{m}$. So, he wants to generate as many as possible pattern strings from $p$ using the following method:
1. select some indices $i_1,i_2,...,i_k$ such that $1 \le i_1 < i_2 < ... < i_k <|p|$ and $|i_j-i_{j+1}| > 1$ for all $1 \le j < k$.
2. swap $p_{i_j}$ and $p_{i_j+1}$ for all $1 \le j \le k$.
Now, for a given a string $s=s_{1}s_{2}...s_{n}$, Professor Zhang wants to find all occurrences of all the generated patterns in $s$.