#include <bits/stdc++.h>
using namespace std;
long long n, t;
void work() {
  cin >> n;
  long long a = 1;
  for (long long i = 2; i <= n / i; i++) {
    if (n % i == 0) {
      a = n / i;
      break;
    }
  }
  cout << a << " " << n - a << endl;
  return;
}
int main() {
  for (cin >> t; t--;) {
    work();
  }
  return 0;
}
