시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB44292074.074%

문제

A prime number (or a prime) is an integer greater than 1 that has no positive divisors other than 1 and itself. An integer greater than one that is not prime is called composite. The fundamental theorem of arithmetic, also called the unique factorization theorem or the unique-primefactorization theorem, states that every integer greater than 1 is either prime or is the product of prime numbers, and that, although the order of the primes in the second case is arbitrary, the primes themselves are not. If we place the prime factors of a composite number in ascending order, then we have a unique prime factorization. Given an integer greater than one either state that the integer is prime or give the unique prime factorization of the composite number.

입력

The first line will be a positive integer, n, indicating the number of input lines that follow. Each input line will contain one integer greater than 1 and less than 231.

출력

For each line of input, other than the first, print the number followed by a colon and either the statement that the number is prime or the unique prime factorization of the composite number. Primes in the unique factorization must be separated by a single blank space, and there must be one blank space after the colon.

예제 입력 1

3
55
7877
3366

예제 출력 1

55: 5 11
7877: prime
3366: 2 3 3 11 17