Time Limit: 10000ms
Memory Limit: 65535kb
Given a string of digits, your task is to find the largest prime number which presents in that string. Our prime numbers are values between 2 to 100,000 only.
Each line contains a string of digits (255 digits at most). The line contains only 0 indicates the end which will not be processed. The input does not exceed 1,000 lines.