#include <bits/stdc++.h>
using namespace std;
int x;
void code() {
  cin >> x;
  for (int n = 1; n < 100000; n++) {
    long long n2 = (n * 1LL * n);
    long long tmp = n2 - x;
    if (tmp <= 0) continue;
    long long m = (long long)sqrt((n2 * 1.0) / tmp);
    if ((n2 - (n / m) * (n / m)) == x) {
      cout << n << " " << m << '\n';
      return;
    }
  }
  cout << -1 << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) {
    code();
  }
}
