Question
Digit Quest

Lila is given an integer M. She must find the smallest integer greater than M that has all distinct digits.

Input
The first line of the input contains a single integer M.
Output
Print the smallest integer greater than N which contains only distinct digits.
Example
Sample Input
98
Sample Output
102

Online