#include <bits/stdc++.h>
int main() {
  int T;
  for (scanf("%d", &T); T--;) {
    int x;
    scanf("%d", &x);
    bool done = false;
    for (int i = 1; i * i < x && !done; i++) {
      if (x % i) continue;
      int lo = i, hi = x / i;
      if (lo % 2 != hi % 2) continue;
      int n = (lo + hi) / 2, v = n - lo;
      int m = n / v;
      while (n / m > v) m++;
      if (n / m < v) continue;
      printf("%d %d\n", n, m);
      done = true;
    }
    if (x == 0)
      puts("1 1");
    else if (!done)
      puts("-1");
  }
  return 0;
}
