TSHOW1 - Amusing numbers

Amusing numbers are numbers consisting only of digits 5 and 6. Given an integer k , display the k-th amusing number.

Input

FIrst line consists of integer N representing number of test cases

Next N lines consist of N integers (1 <= k <= 10^15)

Output

N lines each displaying corresponding k-th amusing number

Example

Input:
2
1
5

Output:
5
65

Added by:Pandian
Date:2012-04-10
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All
Resource:AOL code contest

hide comments
2015-08-18 18:27:35 abhinav vinci
good question ,feeling satisfied after thinking for days for it....()
2015-08-17 06:04:49 shantanu tripathi
nice one... fist attmpt AC :D
2015-08-15 18:34:15
simple stack question
2015-08-08 11:27:30 Aman Verma
@vasayashwanth Why are u posting spoiler, if you want to share some info please write a blog i would be more than happy to read than, may be give the link in comment but dont post comment that spoil the question
2015-07-27 15:57:33 Ankit
very easy :)
2015-07-11 10:12:15
just see the pattern 5,6,55,56,65,66,555,556,565,566,655.........and binary representation of numbers from 0 like 0,1,01,10,000,001,010,011,100............
2015-07-01 13:38:16 SangKuan
i find two way to got ac.
2015-06-23 21:39:43
nice one
2015-06-11 18:33:31 sh
Initially used the logarithm method ,then realised that there is a simple +1 method.
2015-05-26 16:37:01 Parth
good!!
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.