#include <bits/stdc++.h>
using namespace std;
double PI = acos(-1);
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    cout << n - 1 << " " << 1 << '\n';
  }
  return 0;
}
