Super calculator performs only a single arithmetic operation — multiplication of natural numbers. The upper boundary for the range of representable natural numbers in the calculator is unknown; let us denote this boundary by . If the result of multiplication a \cdot b is greater than or equal to (a \cdot b \geq P, where and are the factors), two scenarios are possible:
The answer is (a \cdot b) \bmod P.
The answer is a random number from the range of valid values (calculator malfunction).
Given the values of the factors (, ) and the result (), write a program to analyze the calculator's behavior. The output must be a single number determined as follows:
, if c = a \cdot b;
, if a malfunction occurred;
the minimal value of .
The input is a string containing the numbers , , and , separated by spaces. and are the factors, is the result.
The output is a single number.
Note: The length of the input string does not exceed .
Example 1