Fraction#1002

Fraction

1 second
64 megabytes
Medium

Two numbers and are given. You need to find the value of \frac{a}{b}, written in base .

Input

The input consists of several tests (no more than ). The tests are separated by line breaks. Each test contains three numbers: 1 \leq a \leq 10000, 1 \leq b \leq 10000, 2 \leq k \leq 36. The last line contains two zeros.

Output

For each test, output a line containing the representation of \frac{a}{b} in base . The integer part should be separated from the fractional part by a point. If \frac{a}{b} is an integer, the point should not be printed. The representation must not contain insignificant zeros. If \frac{a}{b} is a periodic fraction, its period should be enclosed in parentheses.

Examples

Example 1

Loading
Loading