#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const long long inf = 0x3f3f3f3f;
const long long maxn = 201110;
const long long M = 1e9 + 7;
long long n, m, k, ok;
signed main() {
  long long T;
  cin >> T;
  while (T--) {
    cin >> n;
    cout << 1 << ' ' << n - 1 << endl;
  }
  return 0;
}
