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.util.*;
import java.io.*;
public class PrimeGift {
    
    
    
    /************************ SOLUTION STARTS HERE ************************/
    
    static long primes[];
    static final long MAX = (long) 1e18;
    static int ptr;
    static void brute(int idx ,int len,  long curr, long collect[]) {
        if(idx == len) { 
            collect[ptr++] = curr;
            return;
        }
        brute(idx + 1, len , curr , collect);
        while(curr <= MAX / primes[idx]) {
            curr *= primes[idx];
            brute(idx + 1, len, curr, collect);
        }
    }
    
        /*
     * UWI's radix sort from http://codeforces.com/contest/912/submission/33951400
     */
    public static long[] radixSort(long[] f){ return radixSort(f, f.length); }
    public static long[] radixSort(long[] f, int n)
    {
        long[] to = new long[n];
        {
            int[] b = new int[65537];
            for(int i = 0;i < n;i++)b[1+(int)(f[i]&0xffff)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < n;i++)to[b[(int)(f[i]&0xffff)]++] = f[i];
            long[] d = f; f = to;to = d;
        }
        {
            int[] b = new int[65537];
            for(int i = 0;i < n;i++)b[1+(int)(f[i]>>>16&0xffff)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < n;i++)to[b[(int)(f[i]>>>16&0xffff)]++] = f[i];
            long[] d = f; f = to;to = d;
        }
        {
            int[] b = new int[65537];
            for(int i = 0;i < n;i++)b[1+(int)(f[i]>>>32&0xffff)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < n;i++)to[b[(int)(f[i]>>>32&0xffff)]++] = f[i];
            long[] d = f; f = to;to = d;
        }
        {
            int[] b = new int[65537];
            for(int i = 0;i < n;i++)b[1+(int)(f[i]>>>48&0xffff)]++;
            for(int i = 1;i <= 65536;i++)b[i]+=b[i-1];
            for(int i = 0;i < n;i++)to[b[(int)(f[i]>>>48&0xffff)]++] = f[i];
            long[] d = f; f = to;to = d;
        }
        return f;
    }

    
    private static void solve() {
        
        int n = nextInt();
        int p[] = nextIntArray(n);
        primes = new long[n];
        for(int i = 0; i < n / 2; i++) {
            primes[i] = p[2 * i];
            primes[n / 2 + i] = p[2 * i + 1];
        }
        if((n & 1) == 1)
            primes[n - 1] = p[n - 1];
        
        // long tt = primes[n - 1];
        // primes[n - 1] = primes[1];
        // primes[1] = tt;
        
        
        // System.out.println(Arrays.toString(primes));
        
        int k = nextInt();
        // long start = System.nanoTime();
       
        long large[] = new long[(int) 2e6];
        Arrays.fill(large, Long.MAX_VALUE);
        ptr = 0;
        brute(0, n / 2, 1, large);
        int szL = ptr;
        long small[] = new long[(int) 2e6];
        Arrays.fill(small, Long.MAX_VALUE);
        ptr = 0;
        brute(n / 2, n, 1, small);
        int szS = ptr;
        
        small = radixSort(small);
        large = radixSort(large);
        long lo = 1 , hi = MAX;
        long find = -1;
        while(lo <= hi) {
            long mid = (lo + hi) >> 1;
            long lessCnt = 0;
            for(int i = 0; i < szS; i++) {
                long other = mid / small[i];
                int l = 0 , h = szL;
                int bs = -1;
                while(l <= h) {
                    int m = (l + h) >> 1;
                    if(other >= large[m]) {
                        bs = m;
                        l = m + 1;
                    }
                    else
                        h = m - 1;
                }
                lessCnt += bs + 1;
            }
            
            if(lessCnt >= k) {
                hi = mid - 1;
                find = mid;
            }
            else
                lo = mid + 1;
        }
        
        println(find);
        // System.out.println("Time " + (System.nanoTime() - start) / 1e9);
    }
    
    
    
    /************************ SOLUTION ENDS HERE ************************/
    
    
    
    // 16 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 750000000
    
    /************************ TEMPLATE STARTS HERE **********************/
    
    public static void main(String[] args) throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
        st     = null;
        solve();
        reader.close();
        writer.close();
    }
    
    static BufferedReader reader;
    static PrintWriter    writer;
    static StringTokenizer st;
    
    static String next()
    {while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}            
    st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
    static String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}             
    static int    nextInt()   {return Integer.parseInt(next());}
    static long   nextLong()  {return Long.parseLong(next());}     
    static double nextDouble(){return Double.parseDouble(next());}
    static char   nextChar()  {return next().charAt(0);}
    static int[]  nextIntArray(int n)         {int[] a= new int[n];   int i=0;while(i<n){a[i++]=nextInt();}  return a;}
    static long[] nextLongArray(int n)        {long[]a= new long[n];  int i=0;while(i<n){a[i++]=nextLong();} return a;}    
    static int[]  nextIntArrayOneBased(int n) {int[] a= new int[n+1]; int i=1;while(i<=n){a[i++]=nextInt();} return a;}            
    static long[] nextLongArrayOneBased(int n){long[]a= new long[n+1];int i=1;while(i<=n){a[i++]=nextLong();}return a;}            
    static void   print(Object o)  { writer.print(o);  }
    static void   println(Object o){ writer.println(o);}
    
    /************************ TEMPLATE ENDS HERE ************************/
    
}