Primorial Number System

No attempts yetTime limit1sMemory limit128 MB

Problem

For any natural number $b \ge 2$, every positive integer $n$ has a unique representation in base $b$:

$$n = a_0 + a_1 b + a_2 b^2 + a_3 b^3 + \cdots$$

where each digit $a_i$ satisfies $0 \le a_i \le b-1$.

Let $p_i$ be the $i$-th prime, so $p_0 = 2,\ p_1 = 3,\ p_2 = 5,\ \dots$. Then every positive integer $n$ also has a unique representation in a numeral system whose place values are built from the primes. This is called the primorial number system.

$$n = a_0 + a_1 p_0 + a_2 p_0 p_1 + a_3 p_0 p_1 p_2 + \cdots$$

Here each digit $a_i$ satisfies $0 \le a_i \le p_i - 1$. For example, $a_3$ satisfies $0 \le a_3 \le p_3 - 1$.

Given a positive integer $n$, write a program that represents it in the primorial number system.

Input

The input consists of several test cases. Each test case is a single line containing one positive integer $n$, with $n \le 2^{31}-1$. The last line contains $0$ and is not processed.

Output

For each test case, output the given number, a space, an equals sign ($=$), and a space, followed by the number written in the primorial number system.

Omit every term whose coefficient is $0$, and join the remaining terms from the lowest place value upward with +. The constant term is printed as just its coefficient; for $i \ge 1$, the $i$-th term is printed as the coefficient followed by the primes $p_0, p_1, \dots, p_{i-1}$ joined with an asterisk (*). For instance, the term $4 p_0 p_1 p_2$ is printed as 4*2*3*5.