A number is called wonderfully-prime if it is a prime number (only divisible by itself and ), and when its digits are reversed, the resulting number is a different prime number. Your task is to output the -th wonderfully-prime number. If this number exceeds 10^6, output .
The input consists of a single integer (1 \le K \le 1000).
The output should be a single integer, which is the answer to the problem.
Örnek 1