#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n;
    cin >> n;
    if (n == 2) {
      cout << 1 << " " << 1 << endl;
      continue;
    }
    if (n % 2 == 0) {
      cout << 2 << " " << n - 2 << endl;
    } else {
      cout << 1 << " " << n - 1 << endl;
    }
  }
}
