#include <bits/stdc++.h>
int GCD(int a, int b) {
  if (a == 0) {
    return b;
  }
  if (b == 0) {
    return a;
  }
  if (a == b) {
    return a;
  }
  if (a > b) {
    return GCD(a - b, b);
  }
  return GCD(a, b - a);
}
int LCM(int a, int b) {
  static int temp = 1;
  if (temp % a == 0 && temp % b == 0) {
    return temp;
  } else {
    temp++;
    LCM(a, b);
    return temp;
  }
}
int main() {
  int tc = 0;
  int a, b = 0;
  int n = 0;
  scanf("%d", &tc);
  for (int i = 0; i < tc; i++) {
    scanf("%d", &n);
    a = 1;
    b = n - 1;
    printf("%d %d\n", a, b);
  }
  return 0;
}
