CSES - KILO 2017 1/5 - Uolevi's language
  • 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 cc and creates a string that consists of a single character cc.

expand (S, c) - takes a string SS and a character cc and creates the string ScSScS.

reverse (S) - reverses the string SS.

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 nn. 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

  • 1n20001 \le n \le 2000

Examples

Input:

abacaba

Output:

10-4

Input:

uolevi

Output:

QAQ