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;
inline int readChar();
template <class T = int>
inline T readInt();
template <class T>
inline void writeInt(T first, char end = 0);
inline void writeChar(int first);
inline void writeWord(const char *s);
static const int buf_size = 4096;
inline int getChar() {
  static char buf[buf_size];
  static int len = 0, pos = 0;
  if (pos == len) {
    pos = 0, len = fread(buf, 1, buf_size, stdin);
  }
  if (pos == len) {
    return -1;
  }
  return buf[pos++];
}
inline int readChar() {
  int c = getChar();
  while (c <= 32) {
    c = getChar();
  }
  return c;
}
template <class T>
inline T readInt() {
  int s = 1, c = readChar();
  T first = 0;
  if (c == '-') s = -1, c = getChar();
  while ('0' <= c && c <= '9') first = first * 10 + c - '0', c = getChar();
  return s == 1 ? first : -first;
}
static int write_pos = 0;
static char write_buf[buf_size];
inline void writeChar(int first) {
  if (write_pos == buf_size)
    fwrite(write_buf, 1, buf_size, stdout), write_pos = 0;
  write_buf[write_pos++] = first;
}
template <class T>
inline void writeInt(T first, char end) {
  if (first < 0) writeChar('-'), first = -first;
  char s[24];
  int n = 0;
  while (first || !n) s[n++] = '0' + first % 10, first /= 10;
  while (n--) writeChar(s[n]);
  if (end) writeChar(end);
}
inline void writeWord(const char *s) {
  while (*s) writeChar(*s++);
}
struct Flusher {
  ~Flusher() {
    if (write_pos) fwrite(write_buf, 1, write_pos, stdout), write_pos = 0;
  }
} flusher;
template <typename T1, typename T2>
inline void chkmin(T1 &first, T2 second) {
  if (first > second) first = second;
}
template <typename T1, typename T2>
inline void chkmax(T1 &first, T2 second) {
  if (first < second) first = second;
}
const string FILENAME = "input";
const int MAXN = 1e5 + 1;
int n;
long long k;
vector<int> p[3];
vector<long long> res[2];
void get(int i, vector<int> &p, long long n, long long cur = 1) {
  if (i == p.size()) {
    res[0].push_back(cur);
    return;
  }
  get(i + 1, p, n, cur);
  while (n / p[i] >= cur) {
    cur *= p[i];
    get(i + 1, p, n, cur);
  }
}
bool check(long long M) {
  long long cnt = 0;
  int R = res[1].size() - 1;
  for (auto i : res[0]) {
    while (R >= 0 && M / i < res[1][R]) --R;
    cnt += R + 1;
  }
  return cnt >= k;
}
int main() {
  ios::sync_with_stdio(0);
  srand(time(0));
  cin >> n;
  p[0].resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> p[0][i];
  }
  cin >> k;
  sort(p[0].begin(), p[0].end());
  for (int i = 0; i < n; ++i) p[1 + (i & 1)].push_back(p[0][i]);
  get(0, p[1], 1e18);
  swap(res[0], res[1]);
  get(0, p[2], 1e18);
  sort(res[0].begin(), res[0].end());
  sort(res[1].begin(), res[1].end());
  long long L = 0, R = 1e18;
  while (R - L > 1) {
    auto M = (L + R) >> 1;
    if (check(M)) {
      R = M;
    } else {
      L = M;
    }
  }
  cout << R << endl;
}