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 namespace std;
int n, k;
vector<long long int> p1;
vector<long long int> p2;
vector<long long int> v1;
vector<long long int> v2;
bool isov(long long int x, long long int y) { return !(x * y / y == x); }
void add1(int x, long long int pro) {
  if (x == p1.size()) return;
  add1(x + 1, pro);
  while (((double)(1e18)) / ((double)pro) / ((double)(p1[x])) > 1) {
    pro *= p1[x];
    v1.push_back(pro);
    add1(x + 1, pro);
  }
}
void add2(int x, long long int pro) {
  if (x == p2.size()) return;
  add2(x + 1, pro);
  while (((double)(1e18)) / ((double)pro) / ((double)(p2[x])) > 1) {
    pro *= p2[x];
    v2.push_back(pro);
    add2(x + 1, pro);
  }
}
int bs(vector<long long int> &v, int l, int r, long long int &x) {
  if (l == r) return l;
  int mid = (l + r) / 2;
  if (v[mid] > x) return bs(v, l, mid, x);
  if (v[mid + 1] <= x) return bs(v, mid + 1, r, x);
  return mid;
}
long long int cal(long long int x) {
  int y1 = bs(v1, 0, v1.size() - 1, x);
  int y2 = (v2.size() == 0) ? 0 : bs(v2, 0, v2.size() - 1, x);
  if (y2 == 0) return y1 + 1;
  long long int ans = y1 + y2 + 1;
  long long int idx1 = y1;
  long long int idx2 = 1;
  while (idx1 > 0 && idx2 > 0 && idx2 <= y2) {
    if (isov(v1[idx1], v2[idx2]) || v1[idx1] * v2[idx2] > x) {
      idx1--;
    } else {
      ans += idx1;
      idx2++;
    }
  }
  return ans;
}
long long int bs(int &kk, long long int l, long long int r) {
  if (l == r) return l;
  long long int mid = (l + r) / 2;
  long long int c = cal(mid);
  if (c > kk) {
    return bs(kk, l, mid);
  }
  if (c < kk) {
    return bs(kk, mid + 1, r);
  }
  if (mid == l) return l;
  long long int mid2 = mid - 1;
  if (cal(mid2) == kk) return bs(kk, l, mid2);
  return mid;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (i % 2 == 0)
      p1.push_back(x);
    else
      p2.push_back(x);
  }
  cin >> k;
  sort(p1.begin(), p1.end());
  sort(p2.begin(), p2.end());
  add1(0, 1);
  add2(0, 1);
  v1.push_back(1);
  v2.push_back(1);
  sort(v1.begin(), v1.end());
  sort(v2.begin(), v2.end());
  if (k == 1) {
    cout << 1;
    return 0;
  }
  cout << bs(k, 1, 1e18);
}