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;
int dx[] = {0, 0, 1, -1, -1, -1, 1, 1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
template <class T>
inline T biton(T n, T pos) {
  return n | ((T)1 << pos);
}
template <class T>
inline T bitoff(T n, T pos) {
  return n & ~((T)1 << pos);
}
template <class T>
inline T ison(T n, T pos) {
  return (bool)(n & ((T)1 << pos));
}
template <class T>
inline T gcd(T a, T b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
template <typename T>
string NumberToString(T Number) {
  ostringstream second;
  second << Number;
  return second.str();
}
inline int nxt() {
  int aaa;
  scanf("%d", &aaa);
  return aaa;
}
inline long long int lxt() {
  long long int aaa;
  scanf("%lld", &aaa);
  return aaa;
}
inline double dxt() {
  double aaa;
  scanf("%lf", &aaa);
  return aaa;
}
template <class T>
inline T bigmod(T p, T e, T m) {
  T ret = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) ret = (ret * p) % m;
    p = (p * p) % m;
  }
  return (T)ret;
}
int ar[1000010];
vector<long long int> v[2];
map<long long int, int> mp;
vector<int> prime;
void dfs(int pos, long long int tmp, int f) {
  if (pos >= prime.size()) {
    v[f].push_back(tmp);
    return;
  }
  dfs(pos + 1, tmp, f);
  if (prime[pos] <= ((long long int)1e18 + 1000) / tmp)
    dfs(pos, tmp * prime[pos], f);
}
long long int go(long long int prod) {
  long long int sum = 0;
  for (int i = 0; i < v[0].size(); i++) {
    long long int need = prod / v[0][i];
    int l = upper_bound(v[1].begin(), v[1].end(), need) - v[1].begin();
    l--;
    sum += (l + 1);
  }
  return sum;
}
int main() {
  int n = nxt();
  for (int i = 0; i < n; i++) {
    ar[i] = nxt();
  }
  sort(ar, ar + n);
  for (int i = 0; i < min(5, n); i++) {
    prime.push_back(ar[i]);
  }
  dfs(0, 1LL, 0);
  prime.clear();
  for (int i = min(5, n); i < n; i++) {
    prime.push_back(ar[i]);
  }
  dfs(0, 1LL, 1);
  sort(v[0].begin(), v[0].end());
  sort(v[1].begin(), v[1].end());
  v[0].erase(unique(v[0].begin(), v[0].end()), v[0].end());
  v[1].erase(unique(v[1].begin(), v[1].end()), v[1].end());
  long long int k = lxt();
  long long int lo = 1;
  long long int hi = (long long int)1e18 + 100;
  while (lo <= hi) {
    long long int mid = (lo + hi) / 2;
    if (go(mid) >= k)
      hi = mid - 1;
    else
      lo = mid + 1;
  }
  cout << lo << endl;
  return 0;
}