#CCC19S2. Pretty Average Primes

Pretty Average Primes

For various given positive integers N>3, find two primes, A and B such that N is the average (mean) of A and B. That is, N should be equal to A+B2{A+B \over 2}.

Recall that a prime number is an integer P>1 which is only divisible by 1 and P. For example, 2, 3, 5, 7, 11 are the first few primes, and 4, 6, 8, 9 are not prime numbers.

Input Specification

The first line of input is the number T (1≤T≤1000), which is the number of test cases. Each of the next T lines contain one integer Ni_i (4≤Ni_i≤1000000,1≤i≤T).

For 6 of the available 15 marks, all Ni_i<1000.

Output Specification

The output will consist of T lines. The ith^{th} line of output will contain two integers, Ai_i and Bi_i, separated by one space. It should be the case that Ni_i = Ai+Bi2{ Ai +Bi \over 2 } and that Ai_i and Bi_i are prime numbers.

If there are more than one possible Ai_i and Bi_i for a particular Ni_i, output any such pair. The order of the pair Ai_i and Bi_i does not matter.

It will be the case that there will always be at least one set of values Ai_i and Bi_ii for any given Ni_i.

Sample Input

4
8
4
7
21

Sample Output

3 13
5 3
7 7
13 29

Explanation of Possible Output for Sample Input

Notice that:

8=3+132{3+13 \over 2},4=5+32{5+3 \over 2},7=7+72{7+7\over2},21=13+292{13+29\over2}.

It is interesting to note, that we can also write

8=5+112{5+11\over2}

21=5+372{5+37\over2}=11+312{11+31\over2}=19+232{19+23\over2}

7=3+112{3+11\over2}

and so any of these pairs could have also been used in output. There is no pairs of primes other than 3 and 5 which average to the value of 4.

Footnote

You may have heard about Goldbach's conjecture , which states that every even integer greater than 2 can be expressed as the sum of two prime numbers. There is no known proof, yet, so if you want to be famous, prove that conjecture (after you finish the CCC).

This problem can be used to help verify that conjecture, since every even integer can be written as 2N, and your task is to find two primes A and B such that 2N=A+B.