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;
long long mod = 1e9 + 7;
long long min(long long a, long long b) { return (a < b) ? a : b; }
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long fp(long long a, long long b) {
  if (b == 0) return 1;
  long long x = fp(a, b / 2);
  x = (x * x) % mod;
  if (b & 1) x = (x * a) % mod;
  return x;
}
auto random_add = [] {
  char *p = new char;
  delete p;
  return uint64_t(p);
};
const uint64_t SEED =
    chrono::steady_clock::now().time_since_epoch().count() * (random_add() | 1);
mt19937_64 rng(SEED);
const long long N = 1e7 + 5;
long long sum[N] = {0}, prime[N] = {0}, ans[N], e[N] = {0};
void solve() {
  long long x;
  cin >> x;
  cout << ans[x] << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  srand(time(0));
  sum[1] = 1;
  memset(ans, -1, sizeof(ans));
  ans[1] = 1;
  for (long long i = 2; i < N; i++) {
    if (prime[i] == 0) {
      for (long long j = 1; j * i < N; j++) {
        if (prime[j * i] == 0) prime[j * i] = i;
      }
    }
    if (prime[i] == i) {
      sum[i] = prime[i] + 1;
      e[i] = i;
    } else {
      if (prime[i / prime[i]] != prime[i])
        sum[i] = sum[i / prime[i]] * prime[i] + sum[i / prime[i]];
      else {
        sum[i] =
            sum[i / prime[i]] * prime[i] + sum[i / prime[i]] - e[i / prime[i]];
        e[i] = sum[i / prime[i]] * prime[i];
      }
    }
    if (sum[i] < N && ans[sum[i]] == -1) {
      ans[sum[i]] = i;
    }
  }
  long long t = 1;
  cin >> t;
  for (long long i = 1; i <= t; i++) {
    solve();
  }
}
