#include <bits/stdc++.h>
#pragma GCC target("sse4.2")
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dr[] = {0, 1, -1, 0, 1, -1, 1, -1};
int dc[] = {1, 0, 0, -1, 1, -1, -1, 1};
long long exp(long long n, long long m, long long md) {
  long long a = 1;
  while (m > 0) {
    if (m & 1) a = (a * n % md) % md;
    m /= 2;
    n = (n * n) % md;
  }
  return a % md;
}
void disp(vector<int> v) {
  for (auto u : v) cout << u << " ";
  cout << "\n";
}
int getSqr(int x) {
  if (x < 0) return -1;
  int l = sqrt(x);
  for (int i = -2; i <= 2; ++i)
    if (l + i >= 0 && (l + i) * (l + i) == x) return l;
  return -1;
}
void go1() {
  long long x;
  cin >> x;
  long long n = 1;
  if (x == 0) {
    cout << 1 << " " << 1 << "\n";
    return;
  }
  for (n = 1; n * (long long)n - (n / 2) * (long long)(n / 2LL) <= x; n++) {
    long long m = n * (long long)n - x;
    long long sq = getSqr(m);
    if (sq <= 0) continue;
    if (n / (n / sq) == sq) {
      cout << n << " " << n / sq << "\n";
      return;
    }
  }
  cout << -1 << "\n";
}
const int N = 200000;
vector<vector<int> > ad;
vector<int> cl;
map<int, int> c;
vector<char> vis;
void dfs(int s) {
  if (vis[s]) return;
  vis[s] = true;
  unordered_set<int> cls;
  for (int u : ad[s]) {
    cls.insert(cl[u]);
  }
  int d = 1;
  while (cls.count(d)) {
    d++;
  }
  cl[s] = d;
  c[d]++;
  for (int u : ad[s]) {
    dfs(u);
  }
}
void go2() {
  int n, m;
  cin >> n >> m;
  int i, j, k;
  ad.assign(n, {});
  cl.assign(n, 0);
  vis.assign(n, false);
  for (i = 0; i < n; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    ad[u].push_back(v);
    ad[v].push_back(u);
  }
  int mx = -1;
  int mxi = 1;
  unordered_set<int> s;
  for (i = 0; i < n; i++) s.insert(i);
  vector<int> ans;
  for (i = 0; i < n; i++) {
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long tt = 1;
  cin >> tt;
  while (tt--) {
    go1();
  }
  return 0;
}
