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;
const int OO = 1e9;
const double EPS = 1e-9;
template <class T>
void _db(const char *dbStr, T e) {
  cout << dbStr << " = " << e << endl;
}
template <class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while (*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ',';
  _db(dbStr + 1, r...);
}
template <class S, class T>
ostream &operator<<(ostream &o, const map<S, T> &v) {
  o << "[";
  int i = 0;
  for (const pair<S, T> &pr : v)
    o << (!i++ ? "" : ", ") << "{" << pr.first << " : " << pr.second << "}";
  return o << "]";
}
template <template <class, class...> class S, class T, class... L>
ostream &operator<<(ostream &o, const S<T, L...> &v) {
  o << "[";
  int i = 0;
  for (const auto &e : v) o << (!i++ ? "" : ", ") << e;
  return o << "]";
}
template <class S, class T>
ostream &operator<<(ostream &o, const pair<S, T> &pr) {
  return o << "(" << pr.first << ", " << pr.second << ")";
}
ostream &operator<<(ostream &o, const string &s) {
  for (const char &c : s) o << c;
  return o;
}
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
template <class T>
using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;
const int MX = 16;
const long long LIM = 1e18 + 5;
int n, p[MX], cnt;
ll num = 1;
V<ll> res[2];
vi nums[2];
void bt(int i, bool b) {
  if (num > LIM) return;
  if (i == int(nums[b].size())) {
    res[b].push_back(num);
  } else {
    bt(i + 1, b);
    if (num <= LIM / nums[b][i]) {
      num *= nums[b][i];
      bt(i, b);
      num /= nums[b][i];
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cin.tie(0);
  cin >> n;
  ll prod = 1;
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  ll k;
  cin >> k;
  sort(p, p + n);
  for (int i = 0; i < n; ++i) nums[i & 1].push_back(p[i]);
  bt(0, 0);
  bt(0, 1);
  sort(res[0].begin(), res[0].end());
  sort(res[1].begin(), res[1].end());
  true;
  true;
  true;
  ll lo = 1, hi = LIM;
  while (lo < hi) {
    ll mid = (lo + hi) / 2;
    if ([&](ll x) {
          ll ret = 0;
          for (int i = 0; i < int(res[0].size()); ++i) {
            if (res[0][i] > x) break;
            ret += upper_bound(res[1].begin(), res[1].end(), x / res[0][i]) -
                   res[1].begin();
          }
          return ret >= k;
        }(mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  cout << lo << '\n';
  return 0;
}