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 bool deb = false;
template <typename T, typename C>
ostream &operator<<(ostream &os, pair<T, C> x) {
  return os << "<" << x.first << ", " << x.second << ">";
}
template <typename T>
auto operator<<(ostream &os, T x) ->
    typename enable_if<is_same<decltype(x.begin()), decltype(x.end())>::value &&
                           !is_same<T, string>::value,
                       ostream &>::type {
  os << "{";
  int cou = 0;
  for (auto c : x) {
    if (cou++) os << ", ";
    os << c;
  }
  return os << "}";
}
template <typename T>
string strmask(T r) {
  string ans;
  for (int i = 0; i < (8 * (int)sizeof(T)); i++) {
    ans += '0' + !!(((T)1 << i) & r);
    if (i % 5 == 4) ans += '.';
  }
  return ans;
}
bool is_prime(int p) {
  for (int i = 2; i * i <= p; ++i)
    if (p % i == 0) return false;
  return true;
}
const long long BOUND = deb ? 1000 : (long long)1e18 + 5;
vector<long long> generate(vector<int> primes) {
  if (primes.size() == 0) {
    return {1LL};
  }
  int p = primes.back();
  primes.pop_back();
  vector<long long> ans;
  for (long long x : generate(primes)) {
    ans.push_back(x);
    while (x * (long double)p < BOUND) {
      x *= p;
      ans.push_back(x);
    }
  }
  return ans;
}
long long under(vector<long long> &n1, vector<long long> &n2, long long bound) {
  int less = ((int)n1.size());
  long long ans = 0;
  for (long long x : n2) {
    if (0)
      cout << "n1"
           << "["
           << "less - 1"
           << "] = "
           << "n1"
           << "[" << less - 1 << "] = " << n1[less - 1] << ' ' << endl
           << "x"
           << " = " << (x) << ' ' << "bound"
           << " = " << (bound) << ' ';
    while (less > 0 && bound / n1[less - 1] < x) less--;
    if (0)
      cout << "add "
           << "less"
           << " = " << (less) << ' ' << "n1"
           << "["
           << "less"
           << "] = "
           << "n1"
           << "[" << less << "] = " << n1[less] << ' ' << "at "
           << "x"
           << " = " << (x) << ' ' << endl;
    ans += less;
  }
  if (0)
    cout << "ans"
         << " = " << (ans) << ' ' << endl;
  return ans;
}
int main() {
  vector<int> primes[2];
  int n;
  long long k;
  scanf("%d", &n);
  int cou = 0;
  while (cou < n) {
    int p;
    scanf("%d", &p);
    primes[!!(++cou & 2)].push_back(p);
  }
  scanf("%lld", &k);
  if (0)
    cout << "primes[0]"
         << " = " << (primes[0]) << ' ' << "primes[1]"
         << " = " << (primes[1]) << ' ' << endl;
  long long pro[2] = {1, 1};
  for (int i = 0; i < (2); i++)
    for (int p : primes[i]) {
      pro[i] *= (int)(log(1e18) / log(p));
    }
  if (0)
    cout << "pro"
         << "[" << 0 << ".." << 1 << "] = "
         << vector<remove_reference<decltype(pro[0])>::type>(&pro[0],
                                                             &pro[1 + 1])
         << ' ' << endl;
  auto n1 = generate(primes[0]), n2 = generate(primes[1]);
  sort(n1.begin(), n1.end());
  sort(n2.begin(), n2.end());
  if (0)
    cout << "siz(n1)"
         << " = " << (((int)n1.size())) << ' ' << "siz(n2)"
         << " = " << (((int)n2.size())) << ' ' << "siz(n1) + siz(n2)"
         << " = " << (((int)n1.size()) + ((int)n2.size())) << ' ' << endl;
  if (0)
    cout << "n1"
         << " = " << (n1) << ' ' << "n2"
         << " = " << (n2) << ' ' << endl;
  long long low = 0, high = BOUND, ans = -1410;
  while (low <= high) {
    long long med = (low + high) / 2;
    if (0)
      cout << "low"
           << " = " << (low) << ' ' << "med"
           << " = " << (med) << ' ' << "high"
           << " = " << (high) << ' ' << endl;
    if (under(n1, n2, med) >= k) {
      ans = med;
      high = med - 1;
    } else {
      low = med + 1;
    }
  }
  printf("%lld\n", ans);
}