Let us denote by d(n) the sum of all divisors of the number n, i.e. d(n) = ∑_{k | n} k.

For example, d(1) = 1, d(4) = 1+2+4=7, d(6) = 1+2+3+6=12.

For a given number c, find the minimum n such that d(n) = c.

Input

The first line contains one integer t (1 ≤ t ≤ 10^4). Then t test cases follow.

Each test case is characterized by one integer c (1 ≤ c ≤ 10^7).

Output

For each test case, output: 

  * "-1" if there is no such n that d(n) = c; 
  * n, otherwise. 

Example

Input


12
1
2
3
4
5
6
7
8
9
10
39
691


Output


1
-1
2
3
-1
5
4
7
-1
-1
18
-1
#include <bits/stdc++.h>
using namespace std;
string en = "\n";
string sp = " ";
string t = "hello";
string Y = "YES\n";
string N = "NO\n";
int dx[] = {-1, 0, 0, 1, -1, -1, 1, 1}, Row, Col;
int dy[] = {0, -1, 1, 0, -1, 1, -1, 1};
int kx[] = {-2, -2, 2, 2, -1, -1, 1, 1};
int ky[] = {-1, 1, -1, 1, -2, 2, -2, 2};
using LL = long long;
using LD = long double;
using ULL = unsigned long long;
bool isprm(LL a) {
  for (LL i = 2; i * i <= a; i++) {
    if (a % i == 0) return false;
  }
  return true;
}
bool palin(string a) {
  for (int i = 0; i < a.size(); i++) {
    if (a.at(i) != a.at(a.size() - i - 1)) return 0;
  }
  return 1;
}
LL binpow(LL a, LL b) {
  LL r = 1;
  while (b > 0) {
    if (b & 1) r = r * a;
    a = a * a;
    b >>= 1;
  }
  return r;
}
LL binpow(LL a, LL b, LL m) {
  a %= m;
  LL r = 1;
  while (b > 0) {
    if (b & 1) r = r * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return r;
}
template <typename T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <typename T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
LL ar[5000005], ans[5000005 + 7];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  LL i, j, k, n, m, l, s = 0, x, y, tc = 1, p, q, a, b, c = 0, d;
  bool f = 0, ff = 0;
  string st, sa, sb, sc;
  char ch;
  for (i = 2; i * i <= 5000005; i++) {
    for (j = i * i; j <= 5000005; j += i) {
      if (j >= 5000005) break;
      a = i, b = j / i;
      ar[j] += i;
      if (a != b) ar[j] += b;
    }
  }
  for (i = 1; i <= 5000005; i++) {
    x = ar[i] + i + 1;
    if (i == 1) x--;
    if (x >= 5000005) {
      break;
    }
    if (ans[x] == 0)
      ans[x] = i;
    else
      ans[x] = min(ans[x], i);
  }
  cin >> tc;
  while (tc--) {
    cin >> x;
    if (x >= 5000005) {
      cout << -1 << en;
      continue;
    }
    if (ans[x])
      cout << ans[x] << en;
    else
      cout << -1 << en;
  }
}
