LearnPy Hub
← Arena
IntermediateRating 1400

Next Palindrome for Huge Numbers

Print the smallest palindrome number 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 for Huge Numbers · Python Arena problem · LearnPy Hub