#include <bits/stdc++.h>
using namespace std;
void solve(int n) {
  cout << "1 " << n - 1 << endl;
  return;
}
int main() {
  int t = 0;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    solve(n);
  }
  return 0;
}
