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;
long long limit = 1e18;
long long k;
int n;
vector<long long> prime;
vector<long long> A, B;
vector<long long> listA, listB;
void generate() {
  long long n, m, i, value;
  vector<long long> coeff;
  listA.clear();
  listA.push_back(1);
  n = A.size();
  coeff.resize(n);
  coeff.clear();
  while (true) {
    m = LLONG_MAX;
    for (i = 0; i < n; ++i) {
      value = A[i] * listA[coeff[i]];
      if (value > limit || value < 1) continue;
      if (value < m) m = value;
    }
    if (m == LLONG_MAX) break;
    listA.push_back(m);
    for (i = 0; i < n; ++i) {
      if (m == A[i] * listA[coeff[i]]) {
        coeff[i]++;
      }
    }
  }
  listB.clear();
  listB.push_back(1);
  n = B.size();
  coeff.resize(n);
  coeff.clear();
  while (true) {
    m = LLONG_MAX;
    for (i = 0; i < n; ++i) {
      value = B[i] * listB[coeff[i]];
      if (value > limit || value < 1) continue;
      if (value < m) m = value;
    }
    if (m > limit || m < 1) break;
    listB.push_back(m);
    for (i = 0; i < n; ++i) {
      if (m == B[i] * listB[coeff[i]]) {
        coeff[i]++;
      }
    }
  }
}
long long count(long long x) {
  long long c = 0;
  long long i, n = listB.size(), l, r, mid;
  long long j, t, s = 0, inc = listA.size();
  for (i = 0; i < n; ++i) {
    t = x / listB[i];
    if (t <= 0) break;
    l = 0;
    r = inc - 1;
    while (true) {
      mid = (l + r + 1) / 2;
      if (listA[mid] == t) {
        inc = mid + 1;
        break;
      }
      if (listA[mid] > t)
        r = mid;
      else
        l = mid;
      if (r - l <= 1) {
        if (listA[r] <= t) {
          inc = r + 1;
          break;
        }
        inc = l + 1;
        break;
      }
    }
    s += inc;
  }
  return s;
}
long long answer(long long k) {
  long long l = 1, r = limit, guess;
  if (count(r) == k && count(r - 1) == k - 1) return r;
  while (true) {
    guess = (l + r) / 2;
    if (count(guess) == k && count(guess - 1) == k - 1) return guess;
    if (count(guess) < k) {
      l = guess;
      continue;
    }
    if (count(guess) >= k) {
      r = guess;
      continue;
    }
  }
}
long long power(long long x, long long n) {
  if (n == 0) return 1;
  if (n == 1) return x;
  long long s = power(x, n / 2);
  if (n % 2 == 0) return (s * s);
  return (x * ((s * s)));
}
int main() {
  int i, j;
  cin >> n;
  prime.resize(n);
  for (i = 0; i < n; ++i) {
    cin >> prime[i];
  }
  cin >> k;
  if (n == 1) {
    cout << power(prime[0], k - 1) << endl;
    return 0;
  }
  sort(prime.begin(), prime.end());
  for (i = 0; i < n; ++i) {
    if (i % 2 == 0)
      A.push_back(prime[i]);
    else
      B.push_back(prime[i]);
  }
  generate();
  cout << answer(k) << endl;
  return 0;
  long long next, m, count = 1;
  cout << count << endl;
}