#include <bits/stdc++.h>
int gcd(int n1, int n2) {
  if (n2 != 0)
    return gcd(n2, n1 % n2);
  else
    return n1;
}
int lcm(int a, int b) { return (a * b) / gcd(a, b); }
int main() {
  int times = 0;
  scanf("%d", &times);
  for (int i = 0; i < times; i++) {
    int x;
    scanf("%d", &x);
    if (x % 2 == 0) {
      printf("%d %d\n", x / 2, x / 2);
    } else {
      printf("%d %d\n", 1, x - 1);
    }
  }
}
