A digit string is a string consisting only of digits from '0' to '9' (both inclusive). Let be a digit string, define the following functions:
We say a digit string is a prime string if after parsing it to an integer, this integer is a prime. A digit string is called a looping prime string if for all
,
is a prime string.
Given a digit string , please find a substring of
such that the substring is a looping prime string and after parsing it to an integer the result is as large as possible.
Note that when parsing a digit string to an integer, its leading zeros will be discarded. For example, string "000123" will be parsed to integer 123. But this does not influence the string itself. For example, , not "312".
There is only one test case in a single test file.
The first and only line contains a digit string
(
),
means the length of string
.
Please note that, although the length of
is selected by hand, the content of
is randomly generated. Each digit has equal probability to appear in each position of the string.
Output one line containing one string, indicating the answer. If the answer does not exist, output "-1" (without quotes) instead.