#B3939. Absolute Prime

    ID: 11596 Type: Default 1000ms 256MiB

Absolute Prime

Absolute Prime

An absolute prime is defined as a two-digit number that is a prime and remains a prime when its digits are reversed. For example, 13 is an absolute prime because both 13 and its reverse 31 are prime numbers. Given two positive integers A and B, your task is to print all absolute primes in the range [A, B] (inclusive).

Note: Only two-digit numbers are considered for being absolute primes.

inputFormat

The input consists of a single line containing two positive integers A and B separated by a space.

outputFormat

Print all absolute primes in the interval [A, B] in ascending order, separated by a single space. If there are no absolute primes in the range, output an empty line.

sample

10 100
11 13 17 31 37 71 73 79 97