#codefestivalchinab. [code_festival_china_b]n-th Points

[code_festival_china_b]n-th Points

Problem

Let us define an strict total order relation between 22 distinct points P(x1,y1)P(x_1,y_1),Q(x2,y2)Q(x_2,y_2) on a rectangular coordinate plane as following.

  • If x1+y1neqx2+y2|x_1|+|y_1|\\neq|x_2|+|y_2| and x1+y1<x2+y2|x_1|+|y_1|<|x_2|+|y_2| then P<QP<Q
  • If x1+y1=x2+y2|x_1|+|y_1|=|x_2|+|y_2| and x1neqx2x_1\\neq{x_2} and x1x2x_1<x_2 then PQP<Q
  • If x1+y1=x2+y2|x_1|+|y_1|=|x_2|+|y_2| and x1=x2x_1=x_2 and y1y2y_1<y_2 then PQP<Q
  • If else, P>QP>Q

Your task is to answer many queries that asks, "When you sort the set of all the integer lattice mathbbZ2\\mathbb{Z}^2 in ascending order by the relation defined above, output the nn-th (11-indexed) element."


Input

Input is given in the following format

QQ n1n_1 n2n_2 : nQn_Q

  • On the first line, you will be given an integer Q(1leqQleq100,000)Q (1 \\leq Q \\leq 100,000), the number of queries.
  • On the following QQ lines, each line contains the information of each query. The ii-th (1leqileqQ)(1 \\leq i \\leq Q) line consists of ni(1leqnileq1018)n_i (1 \\leq n_i \\leq 10^{18}), the number nn of the ii-th query.

Output

Output QQ lines, each line containing the answer to each query in the order the queries appear in the input. Make sure to insert a line break at the end of the last line.


Input Example 1


7
1
2
3
4
5
6
1000000000000000000

Output Example 1


0 0
-1 0
0 -1
0 1
1 0
-2 0
263818038 443288743