#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    long long k = (long long)sqrt(n), a, b, maxim = 1000000009;
    for (long long i = k; i >= 1; i--) {
      if (n % i == 0) {
        long long d = n / i;
        if (maxim > max(i, n - i)) {
          a = i;
          b = n - i;
          maxim = max(i, n - i);
        }
        if (maxim > max(d, n - d) && d != i && i != 1) {
          a = d;
          b = n - d;
          maxim = max(d, n - d);
        }
      }
    }
    cout << a << " " << b << endl;
  }
  return 0;
}
