TWINP2 - 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 relaxed source code length, at TWINP.)


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

hide comments
2022-06-23 06:02:51 Ishan
if TWINP and TWINP2 are both tutorials, which is the clasical one ?
2013-04-18 18:21:05 [Lakshman]
AC with exactly 512B...HaHa...Sieve is working fine..

Last edit: 2013-04-18 18:21:18
2012-04-11 14:35:17 numerix
Interesting variant, but source limit must be stricter to be a real challenge. 1000 B should be enough.
2012-04-11 14:35:17 Francky
Nice variant, thanks for this edition.
It can be a classical one with such limits !!!

Last edit: 2012-04-11 19:02:35
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.