#include <bits/stdc++.h>
using namespace std;
long long bsc(long long x, long long y, long long k) {
  long long l = x, r = y, mid, one;
  while (l <= r) {
    mid = l + (r - l) / 2;
    one = y * y - ((y / mid) * (y / mid));
    if (k < one)
      r = mid - 1;
    else if (k > one)
      l = mid + 1;
    else
      return mid;
  }
  return -1;
}
int main() {
  long long i, t, n, m, k, j, x, mat;
  cin >> t;
  while (t--) {
    cin >> x;
    mat = sqrt((4 * x) / 3) + 10;
    for (n = 1; n <= mat; n++) {
      if (n * n - x < 0) continue;
      m = bsc((long long)1, n, x);
      if (m != -1) break;
    }
    if (m == -1)
      cout << m << endl;
    else
      cout << n << " " << m << endl;
  }
  return 0;
}
