In Prime Land everyone uses a prime-base number system. In this system every positive integer $x$ is written as follows. Let ${p_i}{i=0}^{\infty}$ be the increasing sequence of all prime numbers, so $p_0 = 2$, $p_1 = 3$, $p_2 = 5$, and so on. Every integer $x > 1$ has exactly one factorization into prime powers, so there is an index $k_x$ and uniquely determined exponents $e{k_x}, e_{k_x - 1}, \dots, e_1, e_0$ with $e_{k_x} > 0$ such that
$$x = p_{k_x}^{e_{k_x}} \cdot p_{k_x - 1}^{e_{k_x - 1}} \cdots p_1^{e_1} \cdot p_0^{e_0}.$$
The sequence $(e_{k_x}, e_{k_x - 1}, \dots, e_1, e_0)$ is the representation of $x$ in the prime-base number system.
In this system multiplication and division are easy, but addition and subtraction are hard. Your task is the operation "minus one": given $x$ in prime-base representation, output $x - 1$ in prime-base representation.
For convenience the prime-base representation is written as a sequence of pairs $p_i\ e_i$, listing only those $i$ for which $e_i > 0$, in decreasing order of $p_i$.
The input consists of one or more lines. Every line except the last holds the prime-base representation of a single integer $x$ with $2 < x \le 32767$: the pairs $p_i\ e_i$ (only those with $e_i > 0$) in decreasing order of $p_i$, with all numbers separated by single spaces. The last line contains a single $0$ and is not processed.
For every input line except the last, print one line with $x - 1$ in prime-base representation: the pairs $p_i\ e_i$ (only those with $e_i > 0$) in decreasing order of $p_i$, separated by single spaces.