#P2092. 数字游戏

数字游戏

Description

KC invited his two underlings, K and C, to play a number game. The game is played by K and C taking turns, with K moving first. KC will first specify a number QQ. On each move, the player must write a divisor of the current number to replace the current number, but this divisor cannot be 11 or the number itself. For example, if the current number is 66, then 22 and 33 can be used to replace it, but 11 and 66 cannot. The player who first has no number to write is the winner. Given QQ, K wants to know whether he, as the first player, can win. If he can win, what is the smallest first number he can write that guarantees victory? Assume both K and C play optimally.

Input Format

A single line with a positive integer QQ.

Output Format

The first line is 11 or 22. 11 means K can win, and 22 means C can win.

If K can win, then output on the second line the smallest first number he can write that guarantees victory.

If there is no number that can be written on the first move, then the smallest winning first number is considered to be 00.

6

2

30

1
6

Hint

For 30% of the testdata, Q50Q \le 50. For 100% of the testdata, 2Q10132 \le Q \le 10^{13}.

Translated by ChatGPT 5