{"raw_statement":[{"iden":"problem statement","content":"A positive integer $X$ is called a **\"Neq Number\"** if it satisfies the following condition:\n\n*   When $X$ is written in decimal notation, no two adjacent characters are the same.\n\nFor example, $1$, $173$, and $9090$ are Neq Numbers, while $22$ and $6335$ are not.\nYou are given a positive integer $K$. Find the $K$\\-th smallest Neq Number.\nYou have $T$ test cases to solve."},{"iden":"constraints","content":"*   $1 \\leq T \\leq 100$\n*   $1 \\leq K \\leq 10^{12}$\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$T$\n$\\mathrm{case}_1$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach case is given in the following format:\n\n$K$"},{"iden":"sample input 1","content":"3\n25\n148\n998244353"},{"iden":"sample output 1","content":"27\n173\n2506230721\n\nFor the first test case, here are the smallest $25$ Neq Numbers in ascending order:\n\n*   The nine integers from $1$ to $9$\n*   The nine integers from $10$ to $19$, excluding $11$\n*   The seven integers from $20$ to $27$, excluding $22$\n\nThus, the $25$\\-th smallest Neq Number is $27$."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}