In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of March 24th
(this exercise will still be available for submission after that deadline, but without couting towards your grade)
[to understand the context of this problem, you should read the class #03 exercise sheet]


[PII024] Number Spiral

Imagine the following number spiral (it starts at 01 and goes in ascending order):

|      +--+--+--+--+--+--+
|  +2  |21|22|23|24|25|26|
|      +--+--+--+--+--+--+
|  +1  |20|07|08|09|10|27|
      +--+--+--+--+--+--+
Y   0  |19|06|01|02|11|28|
       +--+--+--+--+--+--+
|  -1  |18|05|04|03|12|29|
|      +--+--+--+--+--+--+
|  -2  |17|16|15|14|13|30|
|      +--+--+--+--+--+--+
                      ...
        -2 -1  0 +1 +2 +3
       ------- X --------

Now imagine a coordinate system (X,Y) where the origin is the number 01. In this way, we can say that 01 is at position (0,0), 02 is at position (1,0), 03 at position (1,-1), 04 at position (0,-1), 05 at position (-1,-1), and so on.

The Problem

Write a program that, given several integers, indicates for each one if its coordinates in the number spiral.

Input

The first line of input contains an integer T, representing the number of test cases that follow.

Each of the following T lines contains one integer N, representing the number we want to compute the coordinates

Output

The output should have exactly T lines, one per input test case.

Each of these lines should in the format N (X,Y) where (X,Y) is the coordinate of number N in the number spiral.

Constraints

The following limits are guaranteed in all the test cases that will be given to your program:

1 ≤ T ≤ 10       Number of test cases
1 ≤ N ≤ 109       Number to compute the coordinates

NOTE: the limits are really high and you must have an efficient solution that can compute this quickly.
A solution that simply tries to simulate the evolution of the spiral advacing the numbers one by one will most likely have Time Limit Exceeded.
Your program will need to be able to answer 10 queries in less than one second.


Example Input Example Output
4
1
14
25
7
1 (0,0)
14 (1,-2)
25 (2,2)
7 (-1,1)

Programming II (CCINF1002)
DCC/FCUP - University of Porto