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 <class T>
ostream& print_collection(ostream& s, T const& a) {
  s << '[';
  for (auto it = begin(a); it != end(a); ++it) {
    s << *it;
    if (it != prev(end(a))) s << " ";
  }
  return s << ']';
}
template <class T, size_t N>
ostream& operator<<(ostream& s, array<T, N> const& a) {
  return print_collection(s, a);
}
template <class T>
ostream& operator<<(ostream& s, vector<T> const& a) {
  return print_collection(s, a);
}
template <class T, class U>
ostream& operator<<(ostream& s, multimap<T, U> const& a) {
  return print_collection(s, a);
}
template <class T>
ostream& operator<<(ostream& s, multiset<T> const& a) {
  return print_collection(s, a);
}
template <class T, class U>
ostream& operator<<(ostream& s, map<T, U> const& a) {
  return print_collection(s, a);
}
template <class T>
ostream& operator<<(ostream& s, set<T> const& a) {
  return print_collection(s, a);
}
template <class A, class B>
ostream& operator<<(ostream& s, pair<A, B> const& a) {
  return s << "(" << (a).first << ", " << (a).second << ")";
}
using ll = long long int;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
using ti = tuple<int, int, int>;
using tl = tuple<ll, ll, ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using vvb = vector<vb>;
using vpi = vector<pi>;
using vpl = vector<pl>;
using vti = vector<ti>;
using vtl = vector<tl>;
using ppi = pair<pi, int>;
using ppl = pair<pl, ll>;
template <class T>
using min_queue = priority_queue<T, vector<T>, greater<T>>;
template <class T>
using max_queue = priority_queue<T>;
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const ll INF_LL = 1e18;
ll n, k;
vl p;
vl d[2];
void gen_subset(int id_set, ll cur, int i) {
  if (i >= n) {
    d[id_set].push_back(cur);
    return;
  }
  gen_subset(id_set, cur, i + 2);
  while (cur <= INF_LL / p[i]) {
    cur *= p[i];
    gen_subset(id_set, cur, i + 2);
  }
}
ll cnt_nb(ll x) {
  ll ans = 0;
  ll j = 0;
  for (ll i = (ll)(d[0].size() - 1); i >= (ll)(0); --i) {
    while (j < d[1].size() && d[1][j] <= x / d[0][i]) ++j;
    ans += j;
  }
  return ans;
}
int main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  cin >> n;
  p.resize(n);
  for (ll i = 0; i < (ll)(n); ++i) {
    cin >> p[i];
  }
  cin >> k;
  for (ll i = 0; i < (ll)(2); ++i) {
    gen_subset(i, 1, i);
    sort((d[i]).begin(), (d[i]).end());
    unique((d[i]).begin(), (d[i]).end());
  }
  ll low = 1;
  ll high = 1e18;
  ll ans = -1;
  while (low <= high) {
    ll mid = low + (high - low) / 2;
    ll res = cnt_nb(mid);
    if (res >= k) {
      high = mid - 1;
      ans = mid;
    } else
      low = mid + 1;
  }
  cout << ans << '\n';
  return 0;
}