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;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T, class T1>
inline void gn(T &first, T1 &second) {
  gn(first);
  gn(second);
}
template <class T, class T1, class T2>
inline void gn(T &first, T1 &second, T2 &z) {
  gn(first);
  gn(second);
  gn(z);
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
template <class T>
inline void printsp(T first) {
  print(first);
  putchar(' ');
}
template <class T>
inline void println(T first) {
  print(first);
  putchar('\n');
}
template <class T, class U>
inline void print(T first, U second) {
  printsp(first);
  println(second);
}
template <class T, class U, class V>
inline void print(T first, U second, V z) {
  printsp(first);
  printsp(second);
  println(z);
}
long long power(long long a, int b, long long ans = 1) {
  for (; b; b >>= 1, a = a * a)
    if (b & 1) ans = ans * a;
  return ans;
}
long long q[2][1220100];
int a[111], b[111], st[111], deg[2];
int calc(long long n) {
  int ed = deg[0] - 1;
  int ans = 0;
  for (int i = 0; i < deg[1]; i++) {
    if (q[1][i] > n) break;
    while (ed >= 0 && q[0][ed] > n / q[1][i]) ed--;
    ans += ed + 1;
  }
  return ans;
}
int main() {
  int n, k;
  gn(n);
  for (int i = 0; i < n; i++) gn(a[i]);
  gn(k);
  long long inf = (long long)1e18 + 10;
  for (int i = 0; i < 2; i++) {
    int r = 0;
    for (int j = 0; j < n; j++)
      if (~(i - j) & 1) b[r] = a[j], st[r++] = 0;
    q[i][deg[i]++] = 1;
    while (r) {
      long long c = inf, d;
      for (int ii = 0; ii < r; ii++) {
        if (c / b[ii] < q[i][st[ii]]) continue;
        if ((d = b[ii] * q[i][st[ii]]) < c) c = d;
      }
      if (c == inf) break;
      q[i][deg[i]++] = c;
      for (int ii = 0; ii < r; ii++) {
        while (st[ii] < deg[i] && c / b[ii] >= q[i][st[ii]]) st[ii]++;
        smin(st[ii], deg[i] - 1);
      }
    }
  }
  long long fi = 0, se = inf;
  while (se - fi > 1) {
    long long mid = se + fi >> 1;
    if (calc(mid) >= k)
      se = mid;
    else
      fi = mid;
  }
  println(se);
  return 0;
}