#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
const long long int infl = LLONG_MAX;
long long int f(long long int n, long long int m) {
  long long int ans = n * n;
  long long int temp = n / m;
  ans = ans - temp * temp;
  return ans;
}
long long int binary_search1(long long int n, long long int x,
                             long long int low, long long int high) {
  long long int mid = (low + high) / 2;
  if (low >= high) {
    return mid;
  } else if (f(n, mid) < x) {
    return binary_search1(n, x, mid + 1, high);
  } else
    return binary_search1(n, x, low, mid);
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int x;
    cin >> x;
    bool flag = false;
    for (long long int n = sqrt(x) + 1; n <= 2 * sqrt(x + 1); n++) {
      long long int m = binary_search1(n, x, 1, n);
      if (f(n, m) == x) {
        cout << n << " " << m << endl;
        flag = true;
        break;
      }
    }
    if (flag == false) cout << -1 << endl;
  }
  return 0;
}
