#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int x, a, b;
    cin >> x;
    if (x % 2 != 0 or x == 2) {
      a = (x - 1);
      b = 1;
    } else {
      a = (x - 2);
      b = 2;
    }
    cout << a << " " << b << endl;
  }
}
