#P1609. 最小回文数

最小回文数

Description

A palindromic number is a number that reads the same from left to right and from right to left.

For example: 121121, 4444, and 33 are palindromic numbers, while 175175 and 3636 are not.

Given a number NN, find a palindromic number PP such that P>NP > N.

There are many such palindromic numbers; your task is to output the smallest one.

Input Format

One line containing a positive integer NN. The value of NN is less than 1010010^{100}, and NN has no leading 00.

Output Format

Your program should output one line: the smallest palindromic number PP with P>NP > N.

44
55

Hint

For 50%50\% of the testdata, N<109N < 10^9.
For 100%100\% of the testdata, N<10100N < 10^{100}.

Translated by ChatGPT 5