Problem: Opposite to Grisha's nice behavior, Oleg, though he has an entire year at his disposal, didn't manage to learn how to solve number theory problems in the past year. That's why instead of Ded Moroz he was visited by his teammate Andrew, who solemnly presented him with a set of n distinct prime numbers alongside with a simple task: Oleg is to find the k-th smallest integer, such that all its prime divisors are in this set. 

Input

The first line contains a single integer n (1 ≤ n ≤ 16).

The next line lists n distinct prime numbers p1, p2, ..., pn (2 ≤ pi ≤ 100) in ascending order.

The last line gives a single integer k (1 ≤ k). It is guaranteed that the k-th smallest integer such that all its prime divisors are in this set does not exceed 1018.

Output

Print a single line featuring the k-th smallest integer. It's guaranteed that the answer doesn't exceed 1018.

Examples

Input

3
2 3 5
7


Output

8


Input

5
3 7 11 13 31
17


Output

93

Note

The list of numbers with all prime divisors inside {2, 3, 5} begins as follows:

(1, 2, 3, 4, 5, 6, 8, ...)

The seventh number in this list (1-indexed) is eight.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long _x = 0;
  int _ch = getchar(), _f = 1;
  for (; !isdigit(_ch) && (_ch != '-') && (_ch != EOF); _ch = getchar())
    ;
  if (_ch == '-') {
    _f = 0;
    _ch = getchar();
  }
  for (; isdigit(_ch); _ch = getchar()) _x = _x * 10 + _ch - '0';
  return _f ? _x : -_x;
}
void write(long long _x) {
  if (_x >= 10)
    write(_x / 10), putchar(_x % 10 + '0');
  else
    putchar(_x + '0');
}
inline void wrt(long long _x, char _p) {
  if (_x < 0) putchar('-'), _x = -_x;
  write(_x);
  if (_p) putchar(_p);
}
int n, R;
int a[19];
long long k;
int cnt = 0;
void dfs(int k, long long now, vector<long long>& vt) {
  if (k > R) {
    vt.push_back(now);
    return;
  }
  dfs(k + 1, now, vt);
  for (long long t = a[k];
       now <= (1000000000000000000 / t + (1000000000000000000 % t != 0));
       t = t * a[k]) {
    dfs(k + 1, now * t, vt);
    if (t > (1000000000000000000 / a[k] + (1000000000000000000 % a[k] != 0)))
      break;
  }
}
vector<long long> vt1, vt2;
long long check(long long x) {
  int p = vt2.size() - 1;
  long long ans = 0;
  for (auto i : vt1) {
    while (p >= 0 && vt2[p] >= (x / i + bool(x % i != 0))) p--;
    ans += p + 1;
  }
  return ans;
}
int main() {
  n = rd();
  srand(998244353);
  for (int i = int(1); i <= (int)(n); i++) a[i] = rd();
  k = rd();
  if (n == 1) {
    long long x = 1;
    for (int i = int(2); i <= (int)(k); i++) x *= a[1];
    wrt(x, '\n');
    return 0;
  }
  sort(a + 1, a + 1 + n);
  random_shuffle(a + 3, a + 1 + n);
  swap(a[2], a[n / 2 + 1]);
  R = n / 2, dfs(1, 1, vt1), R = n;
  dfs(n / 2 + 1, 1, vt2);
  sort(vt1.begin(), vt1.end());
  sort(vt2.begin(), vt2.end());
  long long l = 1, r = 1e18, ans = 1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (check(mid) <= k - 1)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  wrt(ans, '\n');
}