Hide

Problem C
Root of Minus One

Languages en is

You are given a prime p satisfying p=1(mod4) and should find a value r that satisfies 0r<p and r2=1(modp).

Input

The first and only line of input contains a prime p1018 satisfying p=1(mod4).

Output

Print a value r satisfying 0r<p and r2=1(modp).

Sample Input 1 Sample Output 1
73
27
Hide