ZOJ Problem Set - 3346
Once I was asked to play a game with a stranger,the rule of the game was as follows. I and the stranger had different rules. First there was a number n0(1 < n0 < 108),i was asked to choose a number a which is larger or equal to n0 but less or equal to n02,and then the stranger chose a number b according to the number I chose, a/b (a mod b=0) should equal to qk,in which q is a prime number and k is positive, and b should not equal to a. Then I chose number based on the stranger's number(regard the b as n1) on my own rule again, we chose numbers in turns in different rules. When I chose 1990, then I won the game, when the stranger chose number 1, then he won the game.
For example, when n0 = 2, then I could choose 2,3,4 as a, then the stranger can always chose 1 at his first round(because 2,3 are prime numbers and 4 = 22), so the stranger won the game.
Not long, I found the result of the game is in line with the initial number n0, so I want to know before I play this game, will I won this game with the number n0, or is there sometimes nobody will win the game, can you tell me?
There no more than 10000 cases, proceed to the end of file.
In each line there is a single number n0(1 < n0 < 108).
For each case, if I will win, then output "I will win!!"(without the quotes),if the stranger will win, then output "The stranger will win!!"(without the quotes),if nobody can win the game, output "It's an endless game!!"(without the quotes).
2 7 345
The stranger will win!! It's an endless game!! I will win!!
Hint: When n0 = 345, I could chose 1990 at the first round.
Author: SONG, Zhibai
Contest: ZOJ Monthly, June 2010