#include <bits/stdc++.h>
using namespace std;
int Gcd(int a, int b) {
  if (b == 0) {
    return a;
  }
  return Gcd(b, a % b);
}
int Lcm(int a, int b) { return 1LL * a * b / Gcd(a, b); }
pair<int, int> Solve(int n) {
  if (n == 2) {
    return {1, 1};
  }
  if (n % 2 == 0) {
    return {2, n - 2};
  }
  return {1, n - 1};
}
int main() {
  int tests;
  cin >> tests;
  for (int i = 0; i < tests; i += 1) {
    int n;
    cin >> n;
    auto res = Solve(n);
    cout << res.first << " " << res.second << "\n";
  }
  return 0;
}
