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:
//package practice.pset1;

import java.io.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.StringTokenizer;

public class R912E {

    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);

        a = new long[2][3000000];
        Arrays.fill(a[0] , (long)1e18+10);
        Arrays.fill(a[1] , (long) 1e18+10);
        len = new int[2];

        int n = sc.nextInt();
        int[] primes = new int[n];
        for (int i = 0; i < n; i++) {
            primes[i] = sc.nextInt();
        }
        int[] primes1 = new int[n/2];
        int[] primes2 = new int[(n+1)/2];

        for (int i = 0; i < primes.length; i++) {
            if((i&1) == 1) {
                primes1[i/2] = primes[i];
            }
            else {
                primes2[i/2] = primes[i];
            }
        }
        turn = 0;
        gen(primes1, (long)1e18, 0, 1);
        turn = 1;
        gen(primes2, (long)1e18, 0, 1);
        Arrays.sort(a[1]);
        Arrays.sort(a[0]);
        long k = sc.nextInt();

        long lo = 1;
        long hi = (long)1e18+2;

        while(lo < hi){
            long mid = lo + (hi-lo)/2;
            long lessOrEq = lessOrEqual(mid, primes2, primes1);
            if(lessOrEq >= k)
                hi = mid;
            else
                lo = mid+1;
        }

        pw.println(lo);

        pw.flush();
        pw.close();
    }

    static int len[];

    static long lessOrEqual(long n, int[] p1, int[] p2){
        long ans = 0;
        for (int i = 0, j = len[1]; i < len[0]; i++) {
            if(a[0][i] > n)
                break;
            long toFind = n/a[0][i];
            while(j >= 0 && a[1][j] > toFind)
                j--;

            ans += j+1;
        }
        return ans;
    }

    static long a[][];
    static int turn = 0;

    static void gen(int[] primes, long top, int idx, long num){
        if(num > top)
            return;
        if(idx == primes.length) {
            a[turn][len[turn]++] = num;
            return ;
        }
        long cur = 1;
        gen(primes, top, idx+1, num);
        for (int i = 0; i < 60; i++) {
            if(1.0*cur*primes[idx]*num <= top+0.000000001){
                cur *= primes[idx];
                gen(primes, top, idx+1, num*cur);
            }else
                break;
        }
    }


    static class Scanner
    {
        StringTokenizer st; BufferedReader br;
        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}
        public Scanner(String s) throws FileNotFoundException {	br = new BufferedReader(new FileReader(new File(s)));}
        public String next() throws IOException {while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());return st.nextToken();}
        public int nextInt() throws IOException {return Integer.parseInt(next());}
        public long nextLong() throws IOException {return Long.parseLong(next());}
        public String nextLine() throws IOException {return br.readLine();}
        public boolean ready() throws IOException {return br.ready();}
    }
}