#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x;
    cin >> x;
    long long a = 1, b = x - 1;
    cout << a << " " << b << endl;
  }
}
