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

hide comments
Rahadian Koesdijarto Putra: 2016-06-19 11:58:42

Should you need to find the pattern, try to precompute it! Saves you lots of time!

Hint: avoid naive approach, it's all about PATTERN.

ajay_raj: 2016-06-17 23:12:34

Find the pattern :)

ujjwalverma: 2016-06-07 08:44:51

Bad explanation!
one more example:
1
2
output:
442

Last edit: 2016-06-07 08:48:17
top_gun007: 2016-06-06 12:51:32

Easy

sweatygenius: 2016-06-03 17:31:39

DO NOT READ ANY COMMENTS, THEY WILL RUIN THE QUESTION FOR YOU.
People just post solutions here to feel smart themselves :/

Luis Herrera: 2016-05-12 18:22:59

Interesting problem. Try to find the numbers manually or using python in the console and you'll find the pattern.

pamulapati sai teja: 2016-05-01 08:47:16

What would be the answer if inputs are :
1
2

ayushjainsir: 2016-04-30 17:30:50

Did it in first attempt. yohoooo.....
A scary question I say!! but easy

shubhamkhara: 2016-04-25 16:08:34

DO NOT read any of the comments

Shreyas Gupta: 2015-12-24 18:19:59

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


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