#include <bits/stdc++.h>
using namespace std;
const int MAXN = -1;
int n;
int main() {
  int t;
  scanf("%d", &t);
  for (int cs = (0); cs < (int)(t); cs++) {
    scanf("%d", &n);
    printf("%d %d\n", n - 1, 1);
  }
  return 0;
}
