Different numbers
Hard
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Senya is fond of numbers where no two consecutive digits are the same. Given an integer n, your task is to help Senya find the smallest integer that is strictly greater than n and meets his preference.
Input
The input consists of a single integer n (1 ≤ n ≤ 10^18
).
Output
Print the smallest integer greater than n that does not contain any consecutive identical digits.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 10%