#P10958. 启示录
启示录
Problem Description
Ancient people believed that is a number that belongs to the devil.
Moreover, as long as a number’s decimal representation contains three consecutive ’s, ancient people also considered it a devil number, such as , and so on.
Ancient texts often use “the -th smallest devil number” to refer to these numbers, which causes great inconvenience for researchers.
Now please write a program that, given , outputs the corresponding devil number.
Input Format
The first line contains an integer , meaning there are groups of testdata.
Each group of testdata takes one line and contains an integer .
Output Format
For each group of testdata, output one line containing a devil number.
3
2
3
187
1666
2666
66666
Hint
Constraints: , .
Translated by ChatGPT 5