#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, num;
  cin >> n;
  while (n--) {
    cin >> num;
    if (num != 1)
      cout << num - 1;
    else
      cout << num;
    cout << ' ' << 1 << endl;
  }
}
