#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, val;
  vector<int> x;
  cin >> t;
  while (t) {
    cin >> val;
    x.push_back(val);
    t--;
  }
  for (int i = 0; i < x.size(); i++) {
    cout << 1 << " " << x[i] - 1 << endl;
  }
  return 0;
}
