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;
void SieveOfEratosthenes() {
  bool prime[10000001];
  memset(prime, true, sizeof(prime));
  for (long long int p = 2; p * p <= 10000000; p++) {
    if (prime[p] == true) {
      for (long long int i = p * p; i <= 10000000; i += p) {
        prime[i] = false;
      }
    }
  }
}
long long int binpow(long long int a, long long int b) {
  long long int res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a);
    a = (a * a);
    b >>= 1;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (b % a == 0) return a;
  return gcd(b % a, a);
}
long long int power(long long int x, long long int y, long long int p) {
  long long int r = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) r = (r * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return r;
}
long long int modInverse(long long int n, long long int p) {
  return power(n, p - 2, p);
}
long long int nCrModP(long long int n, long long int r, long long int p) {
  long long int fac[100005];
  if (r == 0) return 1;
  return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) %
         p;
}
long long int ans[10000001];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long int j, i, n, t, s, l, r, c, h, k, m, maxi, d, x;
  cin >> t;
  memset(ans, -1, sizeof(ans));
  d = 0;
  for (j = 1; j <= 300000; j++) {
    s = 0;
    for (k = 1; k <= sqrt(j); k++) {
      if (j % k == 0) {
        if (k != j / k)
          s = s + k + j / k;
        else
          s += k;
      }
    }
    d = max(d, s);
    if (ans[s] == -1) ans[s] = j;
  }
  for (i = 0; i < t; i++) {
    cin >> c;
    cout << ans[c] << endl;
  }
}
