#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  long long x, a, b, A, B;
  long long n, m;
  for (int i = 0; i < t; i++) {
    cin >> x;
    if (x == 0) {
      cout << 1 << " " << 1 << "\n";
      continue;
    }
    for (a = 1; a * a < x; a++) {
      if (x % a == 0) {
        b = x / a;
        if (a < b) {
          A = a;
          B = b;
        } else {
          A = b;
          B = a;
        }
        if ((B - A) % 2 == 0) {
          n = B - (B - A) / 2;
          m = 2 * n / (B - A);
          if ((n != 0) && (m != 0)) {
            if ((long long)(n / m) == (B - A) / 2) {
              cout << n << " " << m << "\n";
              break;
            }
          }
        }
      }
    }
    if (a * a >= x) {
      cout << -1 << "\n";
    }
  }
  return 0;
}
