{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":" \n \u003cp\u003eRecently, Nvoenewr learnt palindromes in his class.\u003c/p\u003e \n \u003cp\u003eA palindrome is a nonnegative integer that is the same when read from left to right and when read from right to left. For example, 0, 1, 2, 11, 99, 232, 666, 998244353353442899 are palindromes, while 10, 23, 233, 1314 are not palindromes.\u003c/p\u003e \n \u003cp\u003eNow, given a number, Nvoenewr can determine whether it\u0027s a palindrome or not by using loops which his teacher has told him on the class. But he is now interested in another question: What\u0027s the K-th palindrome? It seems that this question is too difficult for him, so now he asks you for help.\u003c/p\u003e \n \u003cp\u003eNvoenewr counts the number from small to big, like this: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, 33, 44, 55, 66, 77, 88, 99, 101 and so on. So the first palindrome is 0 and the eleventh palindrome is 11 itself.\u003cbr\u003eNvoenewr may ask you several questions, and the K may be very big.\u003c/p\u003e \n "}},{"title":"Input","value":{"format":"HTML","content":" \n \u003cp\u003eThe first line contains one integer T(T \u0026lt;\u003d 20) —— the number of questions that Nvoenewr will ask you.\u003c/p\u003e \n \u003cp\u003eEach of the next T lines contains one integer K. You should find the K-th palindrome for Nvoenewr.\u003c/p\u003e \n \u003cp\u003eLet\u0027s say K is a n-digit number. It\u0027s guaranteed that K \u0026gt;\u003d 1, 1 \u0026lt;\u003d n \u0026lt;\u003d 100000 and the sum of n in all T questions is not greater than 1000000.\u003c/p\u003e \n "}},{"title":"Output","value":{"format":"HTML","content":" \n \u003cp\u003ePrint T lines. The i-th line contains your answer of Nvoenewr\u0027s i-th question.\u003c/p\u003e \n \u003c/div\u003e \n "}},{"title":"Sample Input","value":{"format":"HTML","content":" \n \u003cpre\u003e4\r\n1\r\n10\r\n11\r\n20\u003c/pre\u003e \n "}},{"title":"Sample Output","value":{"format":"HTML","content":" \n \u003cpre\u003e0\r\n9\r\n11\r\n101\u003c/pre\u003e \n "}}]}