9056 - Palindrome Number   

Description

A string is called a number if every digit is a number.

A string is called a palindrome if it’s the same when read backward and forward.

A palindrome number has the properties of a palindrome and a number.

To simplify the problem, every palindrome number cant’s start from 0, ex: 010 is not a palindrome number. But “0” is the smallest palindrome number. Please output the kth smallest palindrome number.

Input

The input includes multiple test cases. In each test case, the one line contains one integer K.

1 <= K <= 2*109

Output

The one line contains the output the kth smallest palindrome number.

Sample Input  Download

Sample Output  Download

Tags




Discuss