There is a variable with an initial value of , and a string of length . consists only of A and M.
For each character of , the following operation is performed.
- If is
A, is added to . If isM, is multiplied by .
is initially , and increases by for every operation performed. Eventually, the sequence of operations end when . Every time an operation is performed, print the largest positive integer such that is a divisor of .
Input
On the first line, a string of length () is given.
Output
On the -th line , print one positive integer: the answer after performing the first operations.
Constraints
- consists only of A and M.
Subtasks
Samples
입력
AMMA
출력
2
3
4
1
The value of is , , , after each operation.