Monday-Saturday Numbers

No attempts yetTime limit2sMemory limit128 MB

Problem

An integer that leaves a remainder of $1$ or $6$ when divided by $7$ is called a $7N + {1, 6}$ number. Because that name is awkward, we will call such an integer a Monday-Saturday number.

For two Monday-Saturday numbers $a$ and $b$, if there exists a Monday-Saturday number $x$ such that $a x = b$, then $a$ is called a Monday-Saturday divisor of $b$. In fact, if a Monday-Saturday number $a$ divides $b$ in the ordinary sense, then $a$ is a Monday-Saturday divisor of $b$, and the converse also holds.

A Monday-Saturday prime is a Monday-Saturday number greater than $1$ that has no Monday-Saturday divisors other than $1$ and itself. If a Monday-Saturday number is prime in the ordinary sense, then it is a Monday-Saturday prime; however, the converse does not hold. For example, $27$ is a Monday-Saturday prime but is not an ordinary prime.

Among the Monday-Saturday divisors of a Monday-Saturday number, those that are Monday-Saturday primes are called its Monday-Saturday prime factors. For example, $27$ is a Monday-Saturday prime factor of $216$ (since $216 = 27 \times 8$).

Every Monday-Saturday number greater than $1$ can be written as a product of one or more Monday-Saturday primes, but this representation is not unique. For example, $216 = 6 \times 6 \times 6 = 8 \times 27$.

Given a Monday-Saturday number, write a program that finds all of its Monday-Saturday prime factors.

Input

The input consists of several test cases. Each test case is a single line containing one Monday-Saturday number. This number is greater than $1$ and less than $300000$. The last line of the input contains $1$, which should not be processed.

Output

For each test case, print the given Monday-Saturday number followed by :, and then print its Monday-Saturday prime factors in ascending order. Print a single space before each Monday-Saturday prime factor.