#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e18;
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return ((a * b) / gcd(a, b));
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = ((x % p) * (x % p)) % p;
  }
  return res % p;
}
long long int modInverse(long long int n, long long int p) {
  return power(n, p - 2, p) % p;
}
void solve() {
  long long int x;
  cin >> x;
  if (x == 0) {
    cout << "1 1" << endl;
    return;
  }
  if (x == 1) {
    cout << "-1" << endl;
    return;
  }
  bool found = false;
  long long int d = sqrt(2 * x);
  for (long long int i = 1; i <= d; i++) {
    long long int var = i * i - x;
    if (var <= 0) continue;
    long long int var2 = sqrt(var);
    if ((var2 * var2) != var || (i / var2) == 0) continue;
    if (i / (i / var2) == var2) {
      found = true;
      cout << i << " " << i / var2 << endl;
      return;
    }
  }
  if (found == false) cout << "-1" << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
