The grasshopper has been sitting at position on the number line for a long time, during which it developed a unique way of moving. In each cycle of movement, it makes exactly two jumps: first by units and then by units along the number line. If the number is positive, it jumps to the right; if negative, it jumps to the left. The time taken for each jump in seconds is equal to the number of units jumped.
For instance, if a = 3 and b = -2, the grasshopper will be at position after seconds. After a total of seconds, it will be at position . Continuing this pattern, it will reach position at seconds and return to position at seconds.
Given the values , , and , determine the number of seconds required for the grasshopper to reach position on the number line. If it is impossible to reach , output .
Three integers , , and — provided in a single line separated by spaces. The absolute values of these integers do not exceed 10^9.
The number of seconds required to reach position , or if it is not possible.
Example 1