#include <bits/stdc++.h>
using namespace std;
struct Node {
  long long int dist = INT_MAX;
  long long int s = -1;
  long long int f = -1;
  long long int parent = -1;
  bool visited = false;
};
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int inverse(long long int n, long long int p) {
  return power(n, p - 2, p);
}
int main() {
  int cases;
  cin >> cases;
  while (cases--) {
    long long int x;
    cin >> x;
    cout << 1 << " " << x - 1 << "\n";
  }
  return 0;
}
