---
{"languages_supported":{"0":"NA"},"title":"PRPALIN","category":"NA","old_version":true,"problem_code":"PRPALIN","tags":{"0":"NA"},"layout":"problem"}
---
<h3> All submissions for this problem are available. </h3><p> An integer is said to be a palindrome if it is equal to its
reverse. For example, 79197 and 324423 are palindromes. In this task
you will be given an integer N, 1 N 1000000. You must find
the smallest integer M N such that M is a prime number and M is a
palindrome. </p>
<p>For example, if N is 31 then the answer is 101.</p>
<h3>Input</h3>
<p>A single integer N, (1 N 1000000), on a single line.</p>
<h3>Output</h3>
<p>Your output must consist of a single integer, the smallest prime
palindrome greater than or equal to N.</p>
<h3>Example</h3>
<pre>
<b>Input:</b>
31
<b>Output:</b>
101
</pre>