P9659 [AOJ] Palindromic Number
普及
题目描述

Palindrome

Problem Statement

Find the number of palindromes closest to the integer n.

Note that the non-negative integer x is the number of palindromes, which means that the character string in which x is expressed in decimal notation and the character string in which it is inverted are equal.
For example, 0,7,33,10301 is the number of palindromes, and 32,90,1010 is not the number of palindromes.

Constraints

  • 1 ≤ n ≤ 10 ^ 4

Input

Input follows the following format. All given numbers are integers.

n

Output

Output the number of palindromes closest to n.
If there are multiple such numbers, output the smallest one.

Examples

Input

13

Output

11

Input

7447

Output

7447

Input

106

Output

101

输入格式

见题面

输出格式

见题面

样例输入
13
样例输出
11