- Time limit: 1.00 s
- Memory limit: 512 MB
Uolevi recently created a new programming language. The programming language has only the following three functions for manipulating strings:
new (c)
- takes a character and creates a string that consists of a single character .
expand (S, c)
- takes a string and a character and creates the string .
reverse (S)
- reverses the string .
Your task is to find out if a given string could have been created using Uolevi's programming language.
Input
The only line of input contains one string of length . The string consists of lowercase english letters.
Output
Output 10-4
if the string could have been created by Uolevi's programming language and QAQ
otherwise.
Constraints
Examples
Input:
abacaba
Output:
10-4
Input:
uolevi
Output:
QAQ