You are given a string consisting only of digits. Write a program that, among all contiguous substrings of the string interpreted as integers, finds the one that is prime and has the largest value.
In this problem, a number is considered prime only if it is a prime between $2$ and $100{,}000$ inclusive.
The input consists of several test cases. The number of test cases does not exceed $1{,}000$.
Each test case is given on its own line as a digit string whose length does not exceed $255$. The last line of the input contains a single $0$, which marks the end of the input.
Only inputs in which at least one substring is prime are given.
For each test case, print on its own line the largest-valued prime substring.