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: // "static void main" must be defined in a public class.
  
  //System.out.println();
  // System.out.print();
  
  import java.util.*;
  import java.io.*;
  public class Main {
      
      
      static boolean isPrime(int n)
      {
          // Corner cases
          if (n <= 1) return false;
          if (n <= 3) return true;
           
          // This is checked so that we can skip
          // middle five numbers in below loop
          if (n % 2 == 0 || n % 3 == 0) return false;
           
          for (int i = 5; i * i <= n; i = i + 6)
              if (n % i == 0 || n % (i + 2) == 0)
              return false;
           
          return true;
      }
       
      // Function to return the smallest
      // prime number greater than N
      static int nextPrime(int N)
      {
       
          // Base case
          if (N <= 1)
              return 2;
       
          int prime = N;
          boolean found = false;
       
          // Loop continuously until isPrime returns
          // true for a number greater than n
          while (!found)
          {
              prime++;
       
              if (isPrime(prime))
                  found = true;
          }
       
          return prime;
      }
      
      
      public static int findXorSum(int arr[], int n)
      {
          // variable to store
          // the final sum
          long sum = 0;
       
          // multiplier
          long mul = 1;
       
          for (int i = 0; i < 30; i++)
          {
       
              // variable to store number of
              // sub-arrays with odd number of elements
              // with ith bits starting from the first
              // element to the end of the array
              long c_odd = 0;
       
              // variable to check the status
              // of the odd-even count while
              // calculating c_odd
              boolean odd = false;
       
              // loop to calculate initial
              // value of c_odd
              for (int j = 0; j < n; j++)
              {
                  if ((arr[j] & (1 << i)) > 0)
                      odd = (!odd);
                  if (odd)
                      c_odd++;
              }
       
              // loop to iterate through
              // all the elements of the
              // array and update sum
              for (int j = 0; j < n; j++)
              {
                  sum += (mul%1000000007 * c_odd%1000000007)%1000000007;
       
                  if ((arr[j] & (1 << i)) > 0)
                      c_odd = (n - j - c_odd);
              }
       
              // updating the multiplier
              mul = (mul%1000000007 * 2)%1000000007;
          }
       
          // returning the sum
          return (int)sum;
      }
      
      
      public static long fact(long n)
      {
          return (n == 1 || n == 0) ? 1 : n * fact(n - 1);
      }
      
      public static long nCr(long n, long r){
          return fact(n) / (fact(r) * fact(n - r));
      }
      
      public static long nPr(long n, long r){
          return fact(n) / fact(n - r);
      }
      
      public static long gcd(long a , long b){
          if(b==0){
              return a;
          }
          return gcd(b,a%b);
      }
      
      public static long lcm(long a, long b){return (a*b)/gcd(a,b);}
      
      public static long fPow(long x, long y, long p){
          long res = 1; // Initialize result
  
          x = x % p; // Update x if it is more than or
          // equal to p
  
          if (x == 0)
            return 0; // In case x is divisible by p;
  
          while (y > 0)
          {
  
            // If y is odd, multiply x with result
            if ((y & 1) != 0)
              res = (res * x) % p;
  
            // y must be even now
            y = y >> 1; // y = y/2
            x = (x * x) % p;
          }
          return res;
      }
      
      public static int binS(int[] sortedArray, int key, int low, int high) {
      int index = Integer.MAX_VALUE;
      
      while (low <= high) {
          int mid = low  + ((high - low) / 2);
          if (sortedArray[mid] < key) {
              low = mid + 1;
          } else if (sortedArray[mid] >= key) {
              high = mid - 1;
          }
          // else if (sortedArray[mid] == key) {
          //     low = mid;
          //     break;
          // }
      }
      return low;
  }
      
      public static int binS1(int[] sortedArray, int key, int low, int high) {
      int index = Integer.MAX_VALUE;
      
      while (low <= high) {
          int mid = low  + ((high - low) / 2);
          if (sortedArray[mid] <= key) {
              low = mid + 1;
          } else if (sortedArray[mid] > key) {
              high = mid - 1;
          }
          // else if (sortedArray[mid] == key) {
          //     low = mid;
          //     break;
          // }
      }
      return high;
  }
          
      public static void main(String[] args) throws IOException {
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          int t = Integer.parseInt(br.readLine());
          for(int q=0;q<t;q++){
              int n = Integer.parseInt(br.readLine());
              // String s[] = br.readLine().split(" ");
              // int a = Integer.parseInt(s[0]);
              // int b = Integer.parseInt(s[1]);
              // int c = Integer.parseInt(s[2]);
              // String s1[] = br.readLine().split(" ");
              // int a[] = new int[n];
              // for(int i=0;i<n;i++){
              //     a[i] = Integer.parseInt(s1[i]);
              // }
              int t1 = (int)Math.ceil(Math.pow(n,0.5));
              // for(int i=0;i<t1;i++){
              //     if()
              // }
              if(t1*t1-t1<n){
                  System.out.println(t1+" "+(t1*t1-n+1));
              }
              else{
                  System.out.println(((t1)-(t1*t1-n+1-t1))+" "+(t1));
              }
          }
      }
  }