An integer is considered handsome if every two of its consecutive digits are of different parity. For a given integer
Please note: Numbers consisting of only one digit are handsome numbers. The distance of two numbers is the absolute value of their difference.
Input
The first and only line of input contains the positive integer
Output
The first and only line of output must contain the required closest handsome number. If two closest numbers exist, output the smaller number first and then the larger one and separate them by a single space.
Scoring
In test cases worth 56 points, it will hold
Sample Input 1
Copy
13
Sample Output 1
Copy
12 14
Sample Input 2
Copy
5801001
Sample Output 2
Copy
5810101
Comments