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;
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v);
template <typename A, typename B>
ostream &operator<<(ostream &cout, pair<A, B> const &p) {
  return cout << "(" << p.first << ", " << p.second << ")";
}
template <typename A>
ostream &operator<<(ostream &cout, vector<A> const &v) {
  cout << "[";
  for (int i = 0; i < v.size(); i++) {
    if (i) cout << ", ";
    cout << v[i];
  }
  return cout << "]";
}
template <typename A, typename B>
istream &operator>>(istream &cin, pair<A, B> &p) {
  cin >> p.first;
  return cin >> p.second;
}
mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
void usaco(string filename) {
  freopen((filename + ".in").c_str(), "r", stdin);
  freopen((filename + ".out").c_str(), "w", stdout);
}
const long double pi = 3.14159265358979323846;
const long long mod = 1000000007;
long long n, m, k, q, l, r, x, y, z;
const long long template_array_size = 1e6 + 5240;
long long a[template_array_size];
long long b[template_array_size];
long long c[template_array_size];
string second, t;
long long ans = 0;
vector<long long> cur;
vector<long long> pr;
void rec(long long v, long long p) {
  if (p == cur.size()) {
    pr.push_back(v);
    return;
  }
  long long x = 1;
  while (x * v <= m) {
    rec(x * v, p + 1);
    if (x * v > m / cur[p]) break;
    x *= cur[p];
  }
}
void solve(int tc = 0) {
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> a[i];
  cin >> k;
  long long mp = n / 2;
  if (n > 14) mp = 6;
  m = 3e18 + 9;
  cur.clear();
  pr.clear();
  for (long long i = 0; i < mp; i++) cur.push_back(a[i]);
  rec(1, 0);
  vector<long long> v1 = pr;
  sort(v1.begin(), v1.end());
  cur.clear();
  pr.clear();
  for (long long i = mp; i < n; i++) cur.push_back(a[i]);
  rec(1, 0);
  vector<long long> v2 = pr;
  sort(v2.begin(), v2.end());
  long long l = 1, r = 1e18 + 7;
  while (l < r) {
    m = (l + r) / 2;
    long long ans = 0;
    long long pt = v2.size() - 1;
    for (long long i = 0; i < v1.size(); i++) {
      if (v1[i] > m) break;
      while (v1[i] > m / v2[pt]) --pt;
      ans += pt + 1;
    }
    if (ans >= k)
      r = m;
    else
      l = m + 1;
  }
  cout << l << '\n';
}
int main() {
  { ios_base::sync_with_stdio(false); }
  { cin.tie(NULL); }
  cout << setprecision(12) << fixed;
  int tc = 1;
  for (int t = 0; t < tc; t++) solve(t);
}