Prime Substring#4098

Prime Substring

10 saniye
64 megabayt
Kolay

Given a string of digits, your task is to find the largest prime number which can be found in that string. Our prime numbers are values from to inclusive.

Giriş

Each line contains a string of digits ( digits at most). The line contains only indicates the end which will not be processed. The input does not exceed lines.

Çıktı

Print out in each line the largest prime number found in each input string.

Örnekler

Örnek 1

Loading
Loading