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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main
{
  public static void main(String[] args)
  {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    E solver = new E();
    solver.solve(1, in, out);
    out.close();
  }

  static class E
  {
    long[] mul = new long[2222222];
    int siz = 0;

    public void solve(int testNumber, InputReader in, PrintWriter out)
    {
      int n = in.nextInt();
      long[] p = new long[n];
      long[] a = new long[n / 2];
      int asiz = 0;
      long[] b = new long[(n + 1) / 2];
      int bsiz = 0;
      for (int i = 0; i < n; ++i)
      {
        p[i] = in.nextLong();
        if ((i & 1) != 0) a[asiz++] = p[i];
        else b[bsiz++] = p[i];
      }
      int k = in.nextInt();
      dfs(0, 1L, a);
      a = Arrays.copyOf(mul, siz);
      siz = 0;
      dfs(0, 1L, b);
      b = Arrays.copyOf(mul, siz);
      Arrays.sort(a);
      Arrays.sort(b);
    /*for(int i=0;i<a.length;++i)
      out.print(a[i]+" ");
    out.print('\n');
    for(int i=0;i<b.length;++i)
      out.print(b[i]+" ");*/
      out.println(bs(1, (long) 1e18, k, a, b));
      //out.println(f(550329031716248441L,a,b));
    }

    public long bs(long lo, long hi, int k, long[] a, long[] b)
    {
      if (hi - lo <= 1)
      {
        int cnt = f(lo, a, b);
        if (cnt == k) return lo;
        return hi;
      }
      long m = (lo + hi) >> 1;
      int cnt = f(m, a, b);
      if (cnt < k) return bs(m + 1, hi, k, a, b);
      return bs(lo, m, k, a, b);
    }

    public int f(long x, long[] a, long[] b)
    {
      int ret = 0;
      int tot = b.length - 1;
    /*for(int i=0;i<a.length;++i)
      for(int j=0;j<b.length;++j)
      {
        //if(a[i]>=(long)1e18/b[j])break;
        if(a[i]<=x/b[j])++ret;
      }*/
      for (long e : a)
      {
        while (tot >= 0 && (b[tot] > x / e)) --tot;
        if (tot < 0) break;
        ret += tot;
        ++ret;
      }
      return ret;
    }

    public void dfs(int i, long l, long[] p)
    {
      //if(siz>2000000)return;
      mul[siz++] = l;

      for (; i < p.length; ++i)
      {
        if (l <= ((long) 1.05e18 + p[i] - 1) / p[i]) dfs(i, l * p[i], p);
        else break;
      }
    }

  }

  static class InputReader
  {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream)
    {
      reader = new BufferedReader(new InputStreamReader(stream), 32768);
      tokenizer = null;
    }

    public String next()
    {
      while (tokenizer == null || !tokenizer.hasMoreTokens())
      {
        try
        {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e)
        {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }

    public int nextInt()
    {
      return Integer.parseInt(next());
    }

    public long nextLong()
    {
      return Long.parseLong(next());
    }

  }
}