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.Random;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.LinkedList;
import java.io.InputStream;

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

    static class TaskE {
        private final static long MAX = 1000000L * 1000000 * 1000000;
        private final static Random rnd = new Random();
        List<Integer>[] primes;
        List<Long> apart;
        List<Long> bpart;
        long[] a;
        long[] b;

        public void solve(int testNumber, QuickScanner in, PrintWriter out) {
            int n = in.nextInt();
            primes = new ArrayList[2];
            for (int i = 0; i < 2; ++i) {
                primes[i] = new ArrayList<>();
            }
            for (int i = 0; i < n; ++i) {
                primes[i % 2].add(in.nextInt());
            }
            apart = new LinkedList<>();
            bpart = new LinkedList<>();
            generate(0, 1, primes[0], bpart, MAX);
            generate(0, 1, primes[1], apart, MAX);

            a = new long[apart.size()];
            copyToArray(apart, a);
            b = new long[bpart.size()];
            copyToArray(bpart, b);

            shuffle(a);
            shuffle(b);
            Arrays.sort(a);
            Arrays.sort(b);

//        System.out.println(apart);
//        System.out.println(bpart);

            long k = in.nextLong();
            long lo = -1, hi = MAX + 1;
            while (hi - lo > 1) {
                long m = lo + (hi - lo) / 2;
                if (count(m) < k) {
                    lo = m;
                } else {
                    hi = m;
                }
            }
            out.println(hi);
        }

        private long count(long x) {
            long ret = 0;
            int at = b.length - 1;
            for (long i : a) {
                while (at >= 0 && i > x / b[at]) {
                    --at;
                }
                ret += at + 1;
            }
            return ret;
        }

        private void generate(int at, long cur, List<Integer> primes, List<Long> nums, long max) {
            if (at == primes.size()) {
                nums.add(cur);
                return;
            }
            generate(at + 1, cur, primes, nums, max);
            while (max > 0) {
                cur *= primes.get(at);
                max /= primes.get(at);
                if (max > 0) {
                    generate(at + 1, cur, primes, nums, max);
                }
            }
        }

        private void shuffle(long[] a) {
            int n = a.length;
            for (int i = 0; i < n; ++i) {
                int idx = i + rnd.nextInt(n - i);
                long tmp = a[i];
                a[i] = a[idx];
                a[idx] = tmp;
            }
        }

        private void copyToArray(List<Long> list, long[] a) {
            int at = 0;
            for (long i : list) {
                a[at++] = i;
            }
        }

    }

    static class QuickScanner {
        BufferedReader in;
        StringTokenizer token;
        String delim;

        public QuickScanner(InputStream inputStream) {
            this.in = new BufferedReader(new InputStreamReader(inputStream));
            this.delim = " \n\t";
            this.token = new StringTokenizer("", delim);
        }

        public QuickScanner(InputStream inputStream, String delim) {
            this.in = new BufferedReader(new InputStreamReader(inputStream));
            this.delim = delim;
            this.token = new StringTokenizer("", delim);
        }

        public boolean hasNext() {
            while (!token.hasMoreTokens()) {
                try {
                    String s = in.readLine();
                    if (s == null) return false;
                    token = new StringTokenizer(s, delim);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return true;
        }

        public String next() {
            hasNext();
            return token.nextToken();
        }

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

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

    }
}