#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long int x, n = 1, m = 1;
    cin >> x;
    while (1) {
      if (n * n - m * m > x)
        m++;
      else if (n * n - m * m < x)
        n++;
      else {
        if (m == n / (n / m)) {
          cout << n << " " << n / m << "\n";
          break;
        } else
          n++, m++;
      }
      if (n > 1000000) {
        cout << "-1\n";
        break;
      }
    }
  }
}
