#include <bits/stdc++.h>
using namespace std;
void solve() {}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t, x;
  cin >> t;
  while (t--) {
    cin >> x;
    cout << 1 << " " << x - 1;
    cout << "\n";
  }
  return 0;
}
