description: Polycarp has found a table having an infinite number of rows and columns. The rows are numbered from 1, starting from the topmost one. The columns are numbered from 1, starting from the leftmost one.
  
  Initially, the table hasn't been filled and Polycarp wants to fix it. He writes integers from 1 and so on to the table as follows.
  
  <image> The figure shows the placement of the numbers from 1 to 10. The following actions are denoted by the arrows.
  
  The leftmost topmost cell of the table is filled with the number 1. Then he writes in the table all positive integers beginning from 2 sequentially using the following algorithm.
  
  First, Polycarp selects the leftmost non-filled cell in the first row and fills it. Then, while the left neighbor of the last filled cell is filled, he goes down and fills the next cell. So he goes down until the last filled cell has a non-filled neighbor to the left (look at the vertical arrow going down in the figure above).
  
  After that, he fills the cells from the right to the left until he stops at the first column (look at the horizontal row in the figure above). Then Polycarp selects the leftmost non-filled cell in the first row, goes down, and so on.
  
  A friend of Polycarp has a favorite number k. He wants to know which cell will contain the number. Help him to find the indices of the row and the column, such that the intersection of the row and the column is the cell containing the number k.
  
  Input
  
  The first line contains one integer t (1 ≤ t ≤ 100) — the number of test cases. Then t test cases follow.
  
  Each test case consists of one line containing one integer k (1 ≤ k ≤ 10^9) which location must be found.
  
  Output
  
  For each test case, output in a separate line two integers r and c (r, c ≥ 1) separated by spaces — the indices of the row and the column containing the cell filled by the number k, respectively.
  
  Example
  
  Input
  
  
  7
  11
  14
  5
  4
  1
  2
  1000000000
  
  
  Output
  
  
  2 4
  4 3
  1 3
  2 1
  1 1
  1 2
  31623 14130
solution: import java.io.BufferedReader;
  import java.io.FileInputStream;
  import java.io.FileNotFoundException;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.util.*;
  import java.io.PrintStream;
              //import java.util.*;
  
          public class Solution {
  
              public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;
  
              static class FastScanner {
  
                      BufferedReader br;
                      StringTokenizer st ;
  
                      FastScanner(){
                          br =  new BufferedReader(new InputStreamReader(System.in));
                          st = new StringTokenizer("");
                      }
  
                      FastScanner(String file) {
  
                          try {
                              br =  new BufferedReader(new InputStreamReader(new FileInputStream(file)));
                              st = new StringTokenizer("");
                          } catch (FileNotFoundException e) {
                              // TODO Auto-generated catch block
                              System.out.println("file not found");
                              e.printStackTrace();
                          }
                          
                      }
                      
  
                      String next() {
                          while (!st.hasMoreTokens())
                              try {
                                  st = new StringTokenizer(br.readLine());
                              } catch (IOException e) {
                              }
                          return st.nextToken();
                      }
  
                      int nextInt() {
                          return Integer.parseInt(next());
                      }
  
                      long nextLong() {
                          return Long.parseLong(next());
                      }
                      String readLine() throws IOException{
                          return br.readLine();
                      }
                  }
                                      
              static class Pair{
                  String word;
                  int cnt;
                  Pair(String word,int cnt){
                      this.word = word;
                      this.cnt = cnt;
                  }
  
              }
  
              
  
          public static void main(String[] args) throws Exception {
              
              FastScanner s = new FastScanner();
  
              
              if(LOCAL){
                  s = new FastScanner("src/input.txt");
                  PrintStream o = new PrintStream("src/sampleout.txt");
                  System.setOut(o);
              }
  
              int tcr = s.nextInt();
           
              for(int tc=0;tc<tcr;tc++){
  
                  long k = s.nextLong();
  
                  long st = 1;
  
                  if(k == 1){
                      System.out.println(1+" "+1);
                      continue;
                  }
                  long col = 1l;
                  
                  long val = 2l;
  
                  while(k > val){
                      long new_val = val + (2*col) + 1;
                      if(new_val > k){break;}
                      val += (2*col) + 1;
                      col++;
                  }
  
                  long half = (col);
  
                  if(k <= (val + half)){
                      long r = (k - val) + 1;
                      long c = col + 1;
                      System.out.println(r+" "+c);
                  }else{
                      long r = col + 1;
                      long c = (col + 1 - (k - (val + half)));
                      System.out.println(r+" "+c);
                  }
  
  
  
  
  
  
              }
  
          }
  
          public static long getA(long num){
              
              if(num == 0l){
                  return 0l;
              }
  
              long ans = num - 1;
  
              long pow = 10;
  
              while((num/pow) > 0){
                  ans = ans + (num/pow);
                  pow = pow * 10l;
              }
  
              return ans;
  
          }
          public static long gcd(long a,long b){
              if(b == 0l){
                  return a;
              }
  
              return gcd(b,a%b);
          }
  
          public static int find(int parent[],int v){
              if(parent[v] == v){
                  return v;
              }
              
              return parent[v] = find(parent, parent[v]);
          }
  
      
  
          public static List<Integer> sieve(){
          
              List<Integer> prime = new ArrayList<>();
  
              int arr[] = new int[100001];
  
              Arrays.fill(arr,1);
  
              arr[1] = 0;
              arr[2] = 1;
  
              for(int i=2;i<=100000;i++){
                  
                  if(arr[i] == 1){
                      
                      prime.add(i);
  
                      for(long j = (i*1l*i);j<100001;j+=i){
                          arr[(int)j] = 0;
                      }
                  }
              }
  
              return prime;
          }
  
          static boolean isPower(long n,long a){
              
              long log = (long)(Math.log(n)/Math.log(a));
  
              long power = (long)Math.pow(a,log);
  
              if(power == n){return true;}
  
              return false;
          }
  
  
          private static int mergeAndCount(int[] arr, int l,int m, int r)
          {
  
              // Left subarray
              int[] left =  Arrays.copyOfRange(arr, l, m + 1);
  
              // Right subarray
              int[] right = Arrays.copyOfRange(arr, m + 1, r + 1);
  
              int i = 0, j = 0, k = l, swaps = 0;
  
              while (i < left.length && j < right.length) {
                  if (left[i] <= right[j])
                      arr[k++] = left[i++];
                  else {
                      arr[k++] = right[j++];
                      swaps += (m + 1) - (l + i);
                  }
              }
              while (i < left.length)
                  arr[k++] = left[i++];
              while (j < right.length)
                  arr[k++] = right[j++];
              return swaps;
          }
  
          // Merge sort function
          private static int mergeSortAndCount(int[] arr, int l,int r)
          {
  
              // Keeps track of the inversion count at a
              // particular node of the recursion tree
              int count = 0;
  
              if (l < r) {
                  int m = (l + r) / 2;
  
                  // Total inversion count = left subarray count
                  // + right subarray count + merge count
  
                  // Left subarray count
                  count += mergeSortAndCount(arr, l, m);
  
                  // Right subarray count
                  count += mergeSortAndCount(arr, m + 1, r);
  
                  // Merge count
                  count += mergeAndCount(arr, l, m, r);
              }
  
              return count;
          }
  
          static class Debug {
              //change to System.getProperty("ONLINE_JUDGE")==null; for CodeForces
              public static final boolean LOCAL = System.getProperty("ONLINE_JUDGE")==null;
              private static <T> String ts(T t) {
                  if(t==null) {
                      return "null";
                  }
                  try {
                      return ts((Iterable) t);
                  }catch(ClassCastException e) {
                      if(t instanceof int[]) {
                          String s = Arrays.toString((int[]) t);
                          return "{"+s.substring(1, s.length()-1)+"}\n";
                      }else if(t instanceof long[]) {
                          String s = Arrays.toString((long[]) t);
                          return "{"+s.substring(1, s.length()-1)+"}\n";
                      }else if(t instanceof char[]) {
                          String s = Arrays.toString((char[]) t);
                          return "{"+s.substring(1, s.length()-1)+"}\n";
                      }else if(t instanceof double[]) {
                          String s = Arrays.toString((double[]) t);
                          return "{"+s.substring(1, s.length()-1)+"}\n";
                      }else if(t instanceof boolean[]) {
                          String s = Arrays.toString((boolean[]) t);
                          return "{"+s.substring(1, s.length()-1)+"}\n";
                      }
                      try {
                          return ts((Object[]) t);
                      }catch(ClassCastException e1) {
                          return t.toString();
                      }
                  }
              }
              private static <T> String ts(T[] arr) {
                  StringBuilder ret = new StringBuilder();
                  ret.append("{");
                  boolean first = true;
                  for(T t: arr) {
                      if(!first) {
                          ret.append(", ");
                      }
                      first = false;
                      ret.append(ts(t));
                  }
                  ret.append("}");
                  return ret.toString();
              }
              private static <T> String ts(Iterable<T> iter) {
                  StringBuilder ret = new StringBuilder();
                  ret.append("{");
                  boolean first = true;
                  for(T t: iter) {
                      if(!first) {
                          ret.append(", ");
                      }
                      first = false;
                      ret.append(ts(t));
                  }
                  ret.append("}");
                  return ret.toString();
              }
              public static void dbg(Object... o) throws Exception {
                  if(LOCAL) {
                      PrintStream ps = new PrintStream("src/Debug.txt");
                      System.setErr(ps);
                      System.err.print("Line #"+Thread.currentThread().getStackTrace()[2].getLineNumber()+": [");
                      for(int i = 0; i<o.length; i++) {
                          if(i!=0) {
                              System.err.print(", ");
                          }
                          System.err.print(ts(o[i]));
                      }
                      System.err.println("]");
                  }
              }
          }
  
  }
  