Bob is an avid chess player who has recently been accused of cheating during a tournament. To defend himself, he has consulted a statistician who has analyzed of his games (numbered to ), each of which he either won or lost. Each game's opponent was assigned a distinct score representing their skill during that game.
In this scoring system, if a player has a score of , they will likely beat any opponent with score less than and be beaten by any opponent with score greater than . If the scores are equal, they may win or lose the game with equal probability. The minimum possible score is and the maximum possible score is .
To prove that Bob is innocent, it suffices to assign him a score that is consistent with the games that he played (i.e. for each game, a statistically likely result occured). Additionally, since the scores are estimates, Bob will consider a score consistent if there are no more than games where the result was statistically unlikely. Note that while it's impossible for any two of Bob's opponents to have the same score, Bob may have the same score as one of his opponents.
Please find whether Bob may be assigned a consistent score in this scoring system. If it is possible to do so, please find the minimum and maximum score that he may be assigned.
Input Specification
The first line will contain two space-separated integers, and .
The second line of input will contain integers, .
The third line of input will contain integers, . For each game, Bob lost the game if and he won if .
Output Specification
On the first line, output INNOCENT
if Bob may be assigned a score, and GUILTY
if he may not.
If he may be assigned a score, output on the second line two space-separated integers, the minimum and maximum score.
Sample Input 1
3 1
5 3 2
1 0 1
Sample Output 1
INNOCENT
2 100000
Sample Explanation 1
Any score greater than is consistent since Bob will likely beat a score of and and allows him to ignore a statistically unlikely loss when facing against a score of . Therefore, Bob's maximum score is the maximum possible score, .
Bob may not have a score less than since there would be statistically unlikely results against scores of and . However, he may have a score of exactly since there would only be unlikely result, against the score of . Therefore, his minimum score is .
Sample Input 2
5 1
0 2 10 4 5
1 0 1 0 1
Sample Output 2
GUILTY
Comments