#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 9, mod = 1e9 + 7, inf = 1e18;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long x;
    cin >> x;
    if (x & 1)
      cout << 1 << " " << x - 1 << "\n";
    else
      cout << x / 2 << " " << x / 2 << "\n";
  }
}
