Under construction

Still being built. Things may change

Diophantine Equation

Time limit1sMemory limit1024 MB

Summary
Given n up to 10^9 (T up to 3000 queries), find positive integers x and y with x^3 + y^3 = n^2, or report that none exist.
Level

Medium6 of 10

Topics
Math, Number theory
Solved
No attempts yet

Problem

Bikarp has the square of a positive integer n2n^2. He wants to split it into a sum of two cubes of positive integers. In other words, he wants to find positive integers xx and yy that solve the following Diophantine equation, where nn is fixed.

n2=x3+y3n^2 = x^3 + y^3

Find a solution, or determine that none exists.

Input

The first line contains TT, the number of test cases (1≤T≤30001 \le T \le 3000). Each of the next TT lines contains a single integer nn (1≤n≤1091 \le n \le 10^9).

Output

Output TT lines. The ii-th line contains the answer for the ii-th test case: either "impossible" if nn cannot be decomposed, or two positive integers xx and yy. If a test case has several solutions, output any of them.

Examples1

  1. Example 1

    Input
    4
    1
    2
    3
    4
    
    Expected output
    impossible
    impossible
    2 1
    2 2