#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, m, li, hi, last = 0, flag = 0;
    cin >> n;
    cout << "1 " << n - 1 << endl;
  }
  return 0;
}
