#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read() {
  T f = 1, x = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
int main() {
  int t = read<int>();
  while (t--) {
    int x = read<int>();
    printf("%d %d\n", 1, x - 1);
  }
  return 0;
}
