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