#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  unsigned long long int t;
  cin >> t;
  while (t--) {
    unsigned long long int x;
    cin >> x;
    unsigned long long int y = x - 1;
    unsigned long long int a = 1, b = x - 1;
    cout << a << " " << b << "\n";
  }
}
