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