1310: 2^x mod n = 1

Memory Limit:32 MB Time Limit:1.000 S Judge Style:Text Compare Creator:
Submit:36 Solved:15

Description

给你一个正整数n,要求你找到最小的x(x>0)满足2^x mod n = 1。

不允许普通用户打印题目,请教师登录后使用。如有疑问请联系管理员!

Input

一个正整数,代表n的值。

1<=n<=32767

Output

如果最小的x存在,则输出2^x mod n = 1(注意x和n要用具体的值代替),否则输出2^? mod n = 1。

Sample Input Copy

2

Sample Output Copy

2^? mod 2 = 1

HINT

思考什么情况下一定不存在最小的x