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