For two given integers and find
where
There are several test cases. Each case is a separate line that contains two positive integers and k~(1 < n < 2 \cdot 10^8, 0 < k < 10^6). The last line contains two zeros and should not be processed.
For each test case print the required value in a separate line.
Example 1