#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, j;
  int index_i, index_j;
  cin >> t;
  while (t--) {
    int a, b, x;
    cin >> x;
    cout << 1 << " " << x - 1 << endl;
  }
  return 0;
}
