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