#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
bool arr[1005];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long x = 1;
    for (long long i = 2; i * i <= n; i++)
      if (n % i == 0) {
        x = n / i;
        break;
      }
    cout << x << " " << n - x << "\n";
  }
  return 0;
}
