EIGHTS - Triple Fat Ladies

Pattern Matchers have been designed for various sorts of patterns. Mr. HKP likes to observe patterns in numbers. After completing his extensive research on the squares of numbers, he has moved on to cubes. Now he wants to know all numbers whose cube ends in 888.

Given a number k, help Mr. HKP find the kth number (indexed from 1) whose cube ends in 888.

Input

The first line of the input contains an integer t, the number of test cases. t test cases follow.

Each test case consists of a single line containing a single integer k (1 <= k <= 2000000000000).

Output

For each test case, output a single integer which denotes the kth number whose cube ends in 888. The result will be less than 263.

Example

Input:
1
1

Output:
192

Added by:Matthew Reeder
Date:2006-10-30
Time limit:1.197s
Source limit:30000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ERL JS-RHINO NODEJS PERL6 VB.NET
Resource:Al-Khawarizm 2006

hide comments
2016-04-30 17:30:50
Did it in first attempt. yohoooo.....
A scary question I say!! but easy
2016-04-25 16:08:34
DO NOT read any of the comments
2015-12-24 18:19:59 Shreyas Gupta
Easy, AC in 1 go. Not good explanation given though.
Tips:
Be careful about the size of k
Don't forget "\n" or endl after each output line
2015-12-21 16:46:33
Be careful with the size of K, costed me 1 WA.... :(
2015-11-25 20:43:06 Timmy Jose
To all the people blatantly posting solutions instead of useful (but incomplete hints), please refrain from doing do. SPOJ really should have comments hidden by default to prevent fools like these from ruining problems.
2015-09-30 23:44:01
finally got ac! bad explanation:(
2015-09-10 16:27:50 jarvis
a song :P 92,42,92,42 :D
and ac....!
2015-08-31 22:14:59
@einsdurchnull, in the example given, k = 1 so we must print the 1st positive integer whose cube ends with 888, i.e. the smallest such integer. If k = 2, we would print the 2nd smallest such integer, k = 3 the third, etc.
2015-08-12 11:22:30 abhishyam
Problem Explanation is not clear.....
Try the following Test Cases
1 -- 192
5 -- 1192
6 -- 1442
78 -- 19442
100 -- 24942

Last edit: 2015-08-12 11:22:48
2015-08-02 13:27:28 ROHIT Kumar
easy qustn but the clarity of question is very poor...output not explained precisely .
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.