MB1  PP numbers
PP numbers are prime numbers and palindromes in decimal notation at once. Your task is to find nth PP number in ascending order. Then calculate product of its nonzero digits  let's call it m  and find mth prime number in ascending order.
Input
In the first line of input there is one positive integer Z (1 ≤ Z ≤ 1000) which states the number of test cases. Following Z lines contain test cases.
Each test case consists of one positive integer n (1 ≤ n ≤ 113) which states the number of PP number to find.
Output
For each test case print in separate line two numbers: nth PP number and mth prime number.
Example
Input:
3 1 5 2
Output:
2 3 11 2 3 5
hide comments
tarun_200:
20200607 13:25:38
size of array taken is 424251 

bro_c_code:
20190326 09:44:00
what is the size that is to taken. 

pratham_1:
20170716 19:28:04
AC in one go:) precomputation is the key , my 5th AC:) 

sri:
20161121 18:28:31
Must try test cases


ani_geek9654:
20161010 17:59:26
EASY AC IN ONE :)


Sarthak Munshi:
20160912 10:48:54
are single digit primes considered a palindrome ? 

karan_batra:
20160828 14:57:00
AC in one go. Easy one :D 

vikikkdi:
20160706 18:13:14
precomputation and o(1) retrieval 

akshayvenkat:
20160702 20:09:29
there is still some problem with the input files, sir. my precomputation solution gave WAs, while predefined array solution gave AC.. why? 

Vars:
20160514 12:02:24
precomputation and u r done!! :)

Added by:  Maciej Boniecki 
Date:  20100402 
Time limit:  0.5s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 GOSU JSMONKEY 
Resource:  2nd Warsaw School of Computer Science Programming Championship 