RSA is one of the most used cryptographic algorithms and it is considered to be one of the most secure existing alternatives. Its basic operation is described below. Two odd prime numbers p and q are chosen and n = pq is computed. Then the totient function φ(n) = (p−1)(q−1) is computed and an integer e satisfying 1 < e < φ(n) is chosen so that gcd(φ(n), e) = 1. Finally the integer d, the inverse multiplicative of e module φ(n) is computed, that is, the integer d satisfying de ≡ 1 mod φ(n). In that way we obtain the public key, which consists of the pair of integers n and e, and the secret key, containing the integers n and d. To encrypt a message m, with 0 < m < n, we calculate c = me modn, and c is the encrypted message. To decrypt the message, that is, to recover the original message, it suffices to compute m = cd mod n. Note that, in order to do that, the secret key must be known; knowing the public key is not enough to decrypt the message. In this problem your task is to break the RSA cryptography. Input The input contains several test cases. A test case consists of one line, which contains three integers N, E, and C, where 15 ≤ N ≤ 109, 1 ≤ E < N and 1 ≤ C < N, such that N and E constitute the RSA public key described above, and C is a message encrypted with that public key. Output For each test case in the input your program must produce a single line, containing a single integer M, 1 ≤ M < N, the original message. Sample Input 1073 71 436 91 43 19 Sample Output 726 33