1379 and Cubes

Time limit1sMemory limit128 MB

Problem

You are given a number S. The last digit of S is one of 1, 3, 7, and 9. For every such S, there is always an integer x whose cube ends with S.

For each test case, find and print any integer x such that the ending digits of x^3 are exactly S, and the decimal length of x is at most the decimal length of S.

Input

The first line contains the number of test cases T.

Each of the next T lines contains one number S. The number S ends in one of 1, 3, 7, and 9, and has at most 10 digits.

Output

For each test case, print one integer x satisfying the condition, one per line.