It is well-known that Anton Trygub likes setting problems about strings with the characters ABC in them. And he likes it even more when we are allowed to do operations on the string. To honour him, but also to improve further on his problems, here is a problem about a string with the characters ABCD in it. You are given a string consisting of the characters ABCD. How many distinct strings can you make, applying the following operation zero or more times?
The first and only line of input contains the string $$$S$$$, ($$$1 \leq |S| \leq 2000$$$)
Print a single line of output with one integer, the number of distinct strings that can be made using the operation repeatedly, modulo $$$10^9+7$$$.
DABC
4
AABBCCDD
1
ABCDABCD
52
In the first example, the string is a cyclic shift of ABCD itself, and so within $$$2$$$ operations, we can get all cyclic shifts of this string, of which there are $$$4$$$.
In the second example, no move is possible in the beginning, so there's only one distinct string you can make.
| Name |
|---|


