RETOCALENTAMIENT - Pertre
Every summer Pertre comes to visit her grandmother in the field. This summer, she has a huge wart. Her grandmother knows that one should treat warts when the moon is waning. Therefore, Pertre have to know the time when the moon is there.
The lunar cycle lasts 30 days. The size of the visible part of the moon (in units Pertre) for each day is 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 and then repeats the cycle, so that after the second one goes back 0, 1, 2...
Since there is no internet in the field, Pertre has been watching the moon during several days (n) consecutive and for each of these days wrote the size of the visible part of the moon. Help her to find out if the moon is waxing or waning in the next day or if this can not be determined by the data you have.
Spanish version.
Input
The first line of the input contains a single integer n (1 ≤ n ≤ 92) - the number of consecutive days Pertre was seeing the size of the visible part of the moon.
The second line contains n integers ai (0 ≤ ai ≤ 15) - Records Pertre.
It is guaranteed that the input data is consistent.
Output
If Pertre can be sure that the size of the visible part of the moon in the day n + 1 is smaller than the size of the visible part in the day n, then print "MENGUANTE" in the only line of output. If she can be sure that the size of the visible part will increase, then print "CRECIENTE". If it is impossible to determine what exactly will happen to the moon, print -1.
Example
Input: 5 3 4 5 6 7 Output: CRECIENTE
Input: 7 12 13 14 15 14 13 12 Output: MENGUANTE
Input: 1 8 Output: -1
Explanation
In the first example, the size of the moon in the next day will be 8, therefore the answer is "CRECIENTE".
In the second example, the size of the moon in the next day will be 11, so the answer is "MENGUANTE".
In the third example, you can not determine what the size of the moon as it can be 7 or 9, therefore the answer is -1.
hide comments
sharapovalibek:
2020-04-10 13:58:20
too easy for basic |
|
vikas0104:
2020-04-05 08:38:48
print CRECIENTE or MENGUANTE or -1 that's it you're done |
|
aquib_ansari:
2018-07-08 17:33:41
The outputs are mis-matching please fix it!. |
Added by: | MaratónAFDM |
Date: | 2016-10-07 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | MAWK BC C NCSHARP CSHARP C++ 4.3.2 COFFEE DART FORTH JAVA JS-RHINO JULIA KTLN OCT PHP PROLOG PYTHON PYPY3 PYTHON3 R RACKET SQLITE SWIFT UNLAMBDA |