Sum of Three Primes

Read each odd K between 7 and 999 and print the lexicographically smallest triple of primes summing to K, or 0.

Easy3Number theoryBrute forceInterviewNo attempts yetTime limit1sMemory limit256 MB

Problem

In number theory, the 3-primes problem is the following conjecture.

"Every odd number greater than 5 can be written as a sum of three primes. The same prime may be added more than once."

For example, 7=2+2+37 = 2 + 2 + 3, 11=2+2+711 = 2 + 2 + 7, and 25=3+3+1925 = 3 + 3 + 19.

Read an odd number KK greater than 5 and write KK as a sum of three primes.

Several triples can work, so the output is fixed to one of them. Sort each triple in ascending order as (a,b,c)(a, b, c) and choose the lexicographically smallest one: the smallest aa, and among those the smallest bb.

Input

The first line contains the number of test cases TT.

Each of the next TT lines contains one integer KK. KK is odd and 7K<10007 \le K < 1000.

Output

Print one line for each test case.

If KK can be written as a sum of three primes, print the lexicographically smallest triple in ascending order, separated by single spaces. Otherwise print 0.