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