#P1609. Next Palindrome Number

    ID: 14895 Type: Default 1000ms 256MiB

Next Palindrome Number

Next Palindrome Number

A palindrome number is a number that remains the same when its digits are reversed. For example, $121$, $44$, and $3$ are palindrome numbers, while $175$ and $36$ are not.

Given an integer $N$, your task is to find the smallest palindrome number $P$ such that $P > N$. There are many palindrome numbers satisfying this condition; you need to output the smallest one.

inputFormat

The input consists of a single integer $N$.

outputFormat

Output the smallest palindrome number $P$ that is greater than $N$.

sample

10
11