408518: GYM103176 K Kth number in Byteland
Description
There are thousands of written languages in the world. Some of them are read from left to right, such as English. Some of them are read from right to left, such as Arabic.
In Byteland, programmers come from many different countries. To avoid ambiguity, the mayor of Byteland decided to publish a new written language and also a new number system that remains the same regardless if it is read from left to right or right to left. Moreover, since the mayor loves odd number, he wants the numbers in the new number system consist of odd number of digits. Therefore, the mayor decided that the $$$k^{th}$$$ number in the new number system shall be the $$$k^{th}$$$ smallest non-negative number in the decimal number system that consists of an odd number of digits and remains unchanged when it is read from either direction.
For example, the $$$1^{st}$$$ number in the new number system is $$$0$$$, and the $$$24^{th}$$$ number is $$$232$$$.
As you are a newcomer in Byteland and you are trying to get familiar with the number system, you want to know the $$$k^{th}$$$ number in the Byteland!
InputThe input contains only one integer, $$$k$$$ ($$$1 \le k \le 10^{9}$$$).
OutputOutput one integer, the $$$k^{th}$$$ number in the new number system in Byteland.
ExamplesInput1Output
0Input
24Output
232