#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5;
bool check(long long int n, long long int y, long long int x) {
  return ((n * n) - (y * y)) == x;
}
void solve() {
  int t;
  cin >> t;
  while (t--) {
    long long int x, sq;
    cin >> x;
    if (x == 0) {
      cout << "1 1\n";
      continue;
    }
    sq = sqrt(x) + 1;
    bool flag = 1;
    for (int t1 = (1); t1 <= (sq); t1++) {
      long long int t2 = x / t1, n, m;
      if (t1 == t2) continue;
      n = (t1 + t2) / 2;
      m = (2 * n) / (t2 - t1);
      if (m <= n && check(n, n / m, x)) {
        cout << n << ' ' << m << '\n';
        flag = 0;
        break;
      }
    }
    if (flag) cout << "-1\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cout << setprecision(8);
  clock_t b = clock();
  solve();
  clock_t e = clock();
  cerr << (double(e - b) / CLOCKS_PER_SEC) << " sec";
  return 0;
}
