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