TWINP - TWIN PRIMES

Twin primes are the pair of prime numbers that differ by two. For example:

  • 3, 5
  • 11, 13
  • 29, 31

The numbers in each pair differ by two.

Input

First line of input consists of T (number of test cases).

Next T lines contains a single number N (indicating the Nth pair of twin primes).

T <= 25, 1 <= N <= 10^5

Output

For every test case output the pair of twin primes in each line separated by a single space.

Example

Input:
3
1
7
11

Output:
3 5
59 61
137 139

(Another tutorial version, with limited source code length, at TWINP2.)


Added by:Avinash
Date:2012-04-07
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:Own Problem

hide comments
2012-04-11 05:19:47 jack(chakradarraju)
Sieve is not enough for this problem
RE: You don't say.

Last edit: 2012-04-08 18:04:31
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.