#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(true);
  cin.tie(NULL);
  cout.tie(NULL);
  int epochs, x;
  cin >> epochs;
  for (int i = 0; i < epochs; i++) {
    cin >> x;
    cout << 1 << " " << x - 1 << endl;
  }
  return 0;
}
