LearnPy Hub
← Arena
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
solution.py
Output appears here
Next Palindrome · Python Arena problem · LearnPy Hub