题目描述
Joey never liked Maths, because he doesn't like counting. Ten digits and base 10 always makes him suffer while counting.
So he wondered what if there were only three numbers 2,3 and 4. Then counting would have been 2,3,4,22,23,24.... and so on.
Now it's Chandler, who is totally fed up with joey's wonderings! Just to stop him from blabbering all this, he asks, "Joey, can you tell me what would be Kth number in your counting, taking 2 as the first?". And Of course, Joey can't answers this! but Can you?
You have to tell what would be the Kth number when only digits you can use are 2,3 and 4.
Input:
First line containing T, the number of test cases.
Then T lines, each with K
Output:
Print the Kth number made-up of digits 2,3 and 4, in a new line.
Constraints:
1 ≤ T ≤ 100000
1 ≤ K ≤ 10^15
SAMPLE INPUT
3
1
4
5
SAMPLE OUTPUT
2
22
23
输入格式
见题面
输出格式
见题面
样例输入
12
1
2
3
4
5
6
7
8
9
10
11
12
样例输出
3
22
24
33
42
44
223
232
234
243
322
324
333
342
344
423
432
434
443
2222
2224
2233
2242
2244
2323
2332
2334
2343
2422
2424
2433
2442
2444
3223
3232
3234
3243
3322
3324
3333
3342
3344
3423
3432
3434
3443
4222
4224
4233
4242
4244
4323
4332
4334
4343
4422
4424
4433
4442
4444
22223
22232
22234
22243
22322
22324
22333
22342
22344
22423
22432
22434
22443
23222
23224
23233
23242
23244
23323
23332
23334
23343
23422
23424
23433
23442
23444
24223
24232
24234
24243
24322
24324
24333
24342
24344
24423
24432
24434
24443
32222
32224
32233
32242
32244
32323
32332
32334
32343
32422
32424
32433
32442
32444
33223
33232
33234
33243
33322
33324
33333
33342
33344
33423
33432
33434
33443
34222
34224
34233
34242
34244
34323
34332
34334
34343
34422
34424
34433
34442
34444
42223
42232
42234
42243
42322
42324
42333
42342
42344
42423
42432
42434
42443
43222
43224
43233
43242
43244
43323
43332
43334
43343
43422
43424
43433
43442
43444
44223
44232
44234
44243
44322
44324
44333
44342
44344
44423
44432
44434
44443
222222
222224
222233
222242
222244
222323
222332
222334
222343
222422
222424
222433
222442
222444
223223
223232
223234
223243
223322
223324
223333
223342
223344
223423
223432
223434
223443
224222
224224
224233
224242
224244
224323
224332
224334
224343
224422
224424
224433
224442
224444
232223
232232
232234
232243
232322
232324
232333
232342
232344
232423
232432
232434
232443
233222
233224
233233
233242
233244
233323
233332
233334
233343
233422
233424
233433
233442
233444
234223
234232
234234
234243
234322
234324
234333
234342
234344
234423
234432
234434
234443
242222
242224
242233
242242
242244
242323
242332
242334
242343
242422
242424
242433
242442
242444
243223
243232
243234
243243
243322
243324
243333
243342
243344
243423
243432
243434
243443
244222
244224
244233
244242
244244
244323
244332
244334
244343
244422
244424
244433
244442
244444
322223
322232
322234
322243
322322
322324
322333
322342
322344
322423
322432
322434
322443
323222
323224
323233
323242
323244
323323
323332
323334
323343
323422
323424
323433
323442
323444
324223
324232
324234
324243
324322
324324
324333
324342
324344
324423
324432
324434
324443
332222
332224
332233
332242
332244
332323
332332
332334
332343
332422
332424
332433
332442
332444
333223
333232
333234
333243
333322
333324
333333
333342
333344
333423
333432
333434
333443
334222
334224
334233
334242
334244
334323
334332
334334
334343
334422
334424
334433
334442
334444
342223
342232
342234
342243
342322
342324
342333
342342
342344
342423
342432
342434
342443
343222
343224
343233
343242
343244
343323
343332
343334
343343
343422
343424
343433
343442
343444
344223
344232
344234
344243
344322
344324
344333
344342
344344
344423
344432
344434
344443
422222
422224
422233
422242
422244
422323
422332
422334
422343
422422
422424