|Contests||Virtual Contests||Problems||Submit||Runs Status||Rank List||Forum|
The number 10 is not a palindrome (even though you could write it as 010) but a zero as leading digit is not allowed.
The input consists of a series of lines with each line containing one integer value i (1 ≤ i ≤ 2*109). This integer value i indicates the index of the palindrome number that is to be written to the output, where index 1 stands for the first palindrome number (1), index 2 stands for the second palindrome number (2) and so on. The input is terminated by a line containing 0.
For each line of input (except the last one) exactly one line of output containing a single (decimal) integer value is to be produced. For each input value i the i-th palindrome number is to be written to the output.
1 12 24 0
1 33 151