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 inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
long long read_long() {
  long long ans = 0;
  char c;
  bool started = false;
  bool is_negative = false;
  while (true) {
    c = getchar();
    if ((c < '0' || c > '9') && c != '-' && !started) continue;
    if ((c < '0' || c > '9') && c != '-' && started) break;
    if (started) {
      ans = ans * 10;
    }
    started = true;
    if (c == '-')
      is_negative = true;
    else
      ans += c - '0';
  }
  if (is_negative) ans *= -1;
  return ans;
}
int n = 16;
int x[100];
vector<int> a, b;
bool is_prime(int val) {
  if (val == 1) return false;
  for (int i = 2; i * i <= val; i++) {
    if (val % i == 0) return false;
  }
  return true;
}
void go(int ind, long long cur, vector<int> &v, set<long long> &second) {
  if (ind == v.size()) {
    second.insert(cur);
    return;
  }
  go(ind + 1, cur, v, second);
  if (cur <= (long long)1e18 / v[ind]) {
    go(ind, cur * v[ind], v, second);
  }
}
bool cmp(long long x, long long y, long long z) {
  if (x <= z / y) return false;
  return true;
}
long long get_cnt(long long value, vector<long long> &a, vector<long long> &b) {
  long long ans = 0;
  int j = (int)b.size() - 1;
  for (int i = 0; i < a.size(); i++) {
    while (j >= 0 && cmp(a[i], b[j], value)) j--;
    ans += j + 1;
  }
  return ans;
}
int main() {
  cin >> n;
  int cur = 2;
  for (int i = 0; i < n; i++) {
    while (!is_prime(cur)) cur++;
    x[i] = cur++;
    cin >> x[i];
  }
  long long k;
  cin >> k;
  sort(x, x + n);
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      a.push_back(x[i]);
    else
      b.push_back(x[i]);
  }
  set<long long> sa, sb;
  go(0, 1ll, a, sa);
  go(0, 1ll, b, sb);
  vector<long long> va, vb;
  for (__typeof(sa.begin()) it = sa.begin(); it != sa.end(); it++)
    va.push_back(*it);
  for (__typeof(sb.begin()) it = sb.begin(); it != sb.end(); it++)
    vb.push_back(*it);
  long long l = 1, r = (long long)1e18;
  long long best = r;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    long long cnt = get_cnt(mid, va, vb);
    if (cnt >= k) {
      best = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  printf("%lld\n", best);
  return 0;
}