#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  cout << "1 " << n - 1 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long test;
  cin >> test;
  while (test--) solve();
  return 0;
}
