Fibonacci Problem Solving Strategy

No attempts yetTime limit2sMemory limit256 MB

Problem

A Gabonacci sequence starts with G1=a and G2=b (0<a≤b) and follows Gi=Gi-1+Gi-2 for i>2. For each n, output the lexicographically smallest pair (a,b) such that n appears in the sequence. Compare pairs by smaller b first, then smaller a.

Input

The first line has T (T≤100). Each following line has n (2≤n≤10^9).

Output

For each test case, print a and b on one line.