A vicious criminal that a famous detective was following for a year disappeared, leaving behind only a strange sequence. Our detective is convinced that an insane criminal left a clue there about where to find him, and now he is trying to decipher all the hidden information in the sequence.
The sequence starts as $$$1$$$, $$$2$$$, $$$3$$$, $$$4$$$, $$$8$$$, $$$12$$$, $$$5$$$, $$$10$$$, $$$15$$$, and so on. The detective almost immediately figured out how it is formed:
To track the criminal, it is necessary to learn how to quickly find the $$$n$$$-th number of this sequence. Help the detective with this task!
The first line contains a single integer $$$t$$$ — the number of elements of the sequence that the detective is interested in ($$$1 \le t \le 1000$$$).
In the $$$i$$$-th of the following $$$t$$$ lines, there is a single integer $$$n_i$$$ — the position of the $$$i$$$-th element of the sequence that you need to find ($$$1 \le n \le 10^{15}$$$).
For each $$$n_i$$$, output the $$$n_i$$$-th number of this mysterious sequence.
9 1 2 3 4 5 6 7 8 9
1 2 3 4 8 12 5 10 15
| Name |
|---|


