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 INF = 1e18;
long long p[20];
int n;
long long set0[1222222];
long long set1[1222222];
int sz0 = 0;
int sz1 = 0;
void dfs(long long val, int f, int s) {
  if (f == 0) {
    set0[sz0++] = val;
  } else {
    set1[sz1++] = val;
  }
  for (int i = s; i < n; i += 2) {
    if ((double)val * p[i] > INF) break;
    dfs(val * p[i], f, i);
  }
}
long long k;
bool judge(long long x) {
  long long p0 = upper_bound(set0, set0 + sz0, x) - set0;
  long long p1 = upper_bound(set1, set1 + sz1, x) - set1;
  long long p2 = 0;
  int pointer = sz1 - 1;
  for (int i = 1; i < sz0; i++) {
    int j = 0;
    for (j = pointer; j > 0; j--) {
      if ((double)set0[i] * set1[j] <= x) {
        break;
      }
    }
    p2 += j;
    pointer = j;
  }
  if (p1 > 0) p1--;
  return p0 + p1 + p2 >= k;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
  }
  dfs(1, 0, 0);
  dfs(1, 1, 1);
  sort(set0, set0 + sz0);
  sort(set1, set1 + sz1);
  cin >> k;
  long long L = 1;
  long long R = INF;
  long long ans = 0;
  while (L <= R) {
    long long mid = (L + R) >> 1;
    if (judge(mid)) {
      R = mid - 1;
      ans = mid;
    } else {
      L = mid + 1;
    }
  }
  cout << ans << endl;
  return 0;
}