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;
using ll = long long;
template <class T>
using V = vector<T>;
template <class T, class U>
using P = pair<T, U>;
namespace IOTech {
template <class T>
void _R(T &x) {
  cin >> x;
}
template <class T, class U>
void _R(P<T, U> &x) {
  _R(x.first), _R(x.second);
}
template <class T>
void _R(V<T> &v) {
  for (T &x : v) _R(x);
}
template <class T>
void _W(const T &x) {
  cout << x;
}
template <class T, class U>
void _W(const P<T, U> &x) {
  _W(x.first), _W(' '), _W(x.second);
}
template <class T>
void _W(const V<T> &x) {
  for (int i = 0, i_n = (((int)x.size())); i < i_n; i++) {
    _W(x[i]);
    if (i + 1 < i_n) _W(' ');
  }
}
void R() {}
template <class T, class... U>
void R(T &val, U &...tail) {
  _R(val);
  R(tail...);
}
void W() {}
template <class T, class... U>
void W(const T &val, const U &...tail) {
  _W(val);
  _W(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
}  // namespace IOTech
using IOTech::R;
using IOTech::W;
template <int MOD>
class Moduls {
  int val;
  using ll = int64_t;
  using ull = uint64_t;

 public:
  Moduls() { val = 0; }
  Moduls(int x) : val(x % MOD) {
    if (val < 0) val += MOD;
  }
  Moduls(ll x) : val(x % MOD) {
    if (val < 0) val += MOD;
  }
  Moduls(unsigned x) : val(x % MOD) {
    if (val < 0) val += MOD;
  }
  Moduls(ull x) : val(x % MOD) {
    if (val < 0) val += MOD;
  }
  Moduls(const Moduls &a) { this->val = a.val; }
  explicit operator int() const { return val; }
  Moduls &operator+=(const Moduls b) {
    this->val += b.val;
    if (this->val >= MOD) this->val -= MOD;
    return *this;
  }
  Moduls &operator-=(const Moduls b) {
    this->val -= b.val;
    if (this->val < 0) this->val += MOD;
    return *this;
  }
  Moduls &operator*=(const Moduls b) {
    this->val = (ll)this->val * b.val % MOD;
    return *this;
  }
  Moduls &operator/=(const Moduls b) {
    *this *= b.inv();
    return *this;
  }
  Moduls pow(ll t) const {
    Moduls ret(1), a = *this;
    if (t < 0) a = a.inv(), t = -t;
    for (; t > 0; t /= 2, a *= a) {
      if (t % 2) ret *= a;
    }
    return ret;
  }
  Moduls inv() const {
    int a = MOD, b = this->val;
    int u = 0, v = 1;
    while (b != 0) {
      int t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    return u;
  }
  friend Moduls operator+(const Moduls &a, const Moduls &b) {
    Moduls ret = a;
    ret += b;
    return ret;
  }
  friend Moduls operator-(const Moduls &a, const Moduls &b) {
    Moduls ret = a;
    ret -= b;
    return ret;
  }
  friend Moduls operator*(const Moduls &a, const Moduls &b) {
    Moduls ret = a;
    ret *= b;
    return ret;
  }
  friend Moduls operator/(const Moduls &a, const Moduls &b) {
    Moduls ret = a;
    ret /= b;
    return ret;
  }
  friend bool operator==(const Moduls &a, const Moduls &b) {
    return a.val == b.val;
  }
  friend bool operator!=(const Moduls &a, const Moduls &b) {
    return a.val != b.val;
  }
  friend istream &operator>>(istream &in, Moduls &a) {
    int x;
    in >> x, a = x;
    return in;
  }
  friend ostream &operator<<(ostream &out, const Moduls &a) {
    return out << a.val;
  }
};
const int mod = 1e9 + 7;
using Mint = Moduls<mod>;
template <class T>
void uniq(V<T> &v) {
  sort(v.begin(), v.end()), v.erase(unique(v.begin(), v.end()), v.end());
}
template <class T>
int uniq(T *v, int n) {
  sort(v, v + n);
  return unique(v, v + n) - v;
}
template <class T, class U>
bool chkmin(T &x, U y) {
  return (y < x) ? (x = y, true) : false;
}
template <class T, class U>
bool chkmax(T &x, U y) {
  return (x < y) ? (x = y, true) : false;
}
Mint qpow(const Mint &a, ll t) { return a.pow(t); }
const ll inf = 1e18;
void dfs(int u, ll cur, const V<V<ll>> &G, V<ll> &res) {
  if (u == ((int)G.size())) {
    res.push_back(cur);
    return;
  }
  for (auto &p : G[u]) {
    if (cur <= inf / p) dfs(u + 1, cur * p, G, res);
  }
}
void get(const V<int> &p, V<ll> &res) {
  V<V<ll>> G(((int)p.size()));
  for (int i = 0, i_n = (((int)p.size())); i < i_n; i++) {
    ll cur = 1;
    G[i].push_back(cur);
    while (cur <= inf / p[i]) {
      G[i].push_back(cur *= p[i]);
    }
  }
  dfs(0, 1, G, res);
}
void Solution() {
  int n;
  R(n);
  V<int> p(n);
  R(p);
  ll k;
  R(k);
  V<ll> a, b;
  if (n < 5) {
    get(p, a);
    sort(a.begin(), a.end());
    W(a[k - 1]);
  } else {
    V<int> px, py;
    for (int i = 0, i_n = ((n + 1) / 2); i < i_n; i++) px.push_back(p[i]);
    for (int i = 0, i_n = (n - (n + 1) / 2); i < i_n; i++)
      py.push_back(p[n - i - 1]);
    get(px, a), get(py, b);
    sort(a.begin(), a.end()), sort(b.begin(), b.end());
    if (((int)a.size()) > ((int)b.size())) swap(a, b);
    ll L = 1, R = inf;
    while (L < R) {
      ll M = (L + R) / 2;
      ll sum = 0;
      for (auto &x : a) {
        sum += upper_bound(b.begin(), b.end(), M / x) - b.begin();
      }
      if (sum >= k)
        R = M;
      else
        L = M + 1;
    }
    W(R);
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cout.setf(ios_base::fixed), cout.precision(10);
  int T = 1;
  while (T--) Solution();
}