Problem E. Elite number

Author:A. Klenin   Time limit:1 sec
Input file:input.txt   Memory limit:256 Mb
Output file:output.txt  

Statement

Let's call an integer number elite if it is divisible by every digit of its decimal representation.

Given an integer x, your program must find the smallest elite number greater than or equal to x.

Input file format

Input file contains the integer x.

Output file format

Output file must contain a single integer — the smallest elite number.

Constraints

1 ≤ x ≤ 1010

Sample tests

No. Input file (input.txt) Output file (output.txt)
1
10
11
2
7777777777
7777777777
3
579916
593595

0.078s 0.010s 13