Hide
Problem F
Primitive Roots
Languages
en
is
Primitive roots modulo
Such values only exist if
Find such a value
Input
The first and only line of input contains a positive integer
Output
Print a primitive root
Sample Input 1 | Sample Output 1 |
---|---|
5 |
2 |
Sample Input 2 | Sample Output 2 |
---|---|
13 |
2 |
Sample Input 3 | Sample Output 3 |
---|---|
202 |
3 |
Sample Input 4 | Sample Output 4 |
---|---|
91 |
-1 |