#include <bits/stdc++.h>
using namespace std;
static const int OO = 0x3f3f3f3f, N = 2 * 1e5 + 10;
static const long long OOL = 1e15 + 1LL;
int dx[] = {1, 1, 2, 2, 3, 3};
int dy[] = {2, 3, 1, 3, 1, 2};
int t, x, a, b;
int main() {
  cin >> t;
  while (t--) {
    cin >> x;
    cout << 1 << " " << x - 1 << endl;
  }
}
