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 int cons;
long long int check(long long int a) {
  if (a >= cons) a %= cons;
  return a;
}
long long int check2(long long int a) {
  a %= cons;
  if (a < 0) a += cons;
  return a;
}
long long int GCD(long long int a, long long int b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
long long int exp(long long int a, long long int n) {
  if (n == 0) return 1;
  if (n == 1) return check(a);
  long long int b = exp(a, n / 2);
  if (n % 2 == 0) return check(b * b);
  return check(b * check(b * a));
}
const int N = 101000;
long long int val;
vector<long long int> vec[20][65];
vector<long long int> prime1, prime2;
bool checker(long long int a, long long int b) { return (a <= (val / b)); }
void solve(vector<long long int> &primes, vector<long long int> &ans) {
  int n = primes.size();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= 63; j++) {
      vec[i][j].clear();
    }
  }
  for (int i = 1; i <= n; i++) {
    long long int pi = primes[i - 1];
    long long int cur = 1;
    for (int j = 1; j <= 63; j++) {
      if (checker(cur, pi)) {
        cur = cur * pi;
        vec[i][j].push_back(cur);
      } else
        break;
    }
  }
  for (int i = 1; i <= n; i++) {
    long long int pi = primes[i - 1];
    long long int cur;
    cur = 1;
    for (int l = 1; l <= 63; l++) {
      if (!checker(cur, pi)) break;
      cur = cur * pi;
      for (int j = 1; j <= 63; j++) {
        if (j + l > 63) break;
        for (int k = 1; k < i; k++) {
          for (auto itr : vec[k][j]) {
            if (checker(itr, cur))
              vec[i][j + l].push_back(itr * cur);
            else
              break;
          }
        }
      }
    }
    for (int j = 1; j <= 63; j++) sort(vec[i][j].begin(), vec[i][j].end());
  }
  ans.push_back(1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= 63; j++) {
      for (auto itr : vec[i][j]) ans.push_back(itr);
    }
  }
  sort(ans.begin(), ans.end());
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cons = 1e9 + 7;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    long long int pi;
    cin >> pi;
    if (i & 1)
      prime1.push_back(pi);
    else
      prime2.push_back(pi);
  }
  long long int l = 1, r = 1e18;
  long long int ans = 1e18;
  long long int k;
  cin >> k;
  val = 1e18;
  vector<long long int> ans1, ans2;
  solve(prime1, ans1);
  solve(prime2, ans2);
  while (l <= r) {
    long long int mid = (l + r) >> 1;
    val = mid;
    long long int less_than = 0;
    long long int pointer = ans2.size() - 1;
    for (auto itr : ans1) {
      while (pointer >= 0 && !checker(itr, ans2[pointer])) pointer--;
      less_than += pointer + 1;
    }
    if (less_than >= k) {
      r = mid - 1;
      ans = min(ans, mid);
    } else
      l = mid + 1;
  }
  cout << ans;
}