EasyRating 1000
Next Palindrome
Print the smallest palindrome number that is strictly greater than n.
Input
One integer n (0 ≤ n ≤ 10⁶).
Output
One integer.
Sample 1
Input
123
Output
131
Sample 2
Input
99
Output
101
Output appears hereOne integer n (0 ≤ n ≤ 10⁶).
One integer.
123
131
99
101
Output appears here