#include <bits/stdc++.h>
using namespace std;
void build(int *arr, int *tree, int l, int r, int treenode) {
  if (l == r) {
    tree[treenode] = arr[l];
    return;
  }
  int mid = (l + r) / 2;
  build(arr, tree, l, mid, 2 * treenode);
  build(arr, tree, mid + 1, r, 2 * treenode + 1);
  tree[treenode] = tree[2 * treenode] + tree[2 * treenode + 1];
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    int x;
    cin >> x;
    if (x == 2)
      cout << 1 << " " << 1 << endl;
    else {
      cout << 1 << " " << x - 1 << endl;
    }
  }
  return 0;
}
