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 ProblemD
{

    static int mod = (int) (1e9+7);
    static InputReader in;
    static PrintWriter out;
    static long maxn = (long) 1e18;
    static int p;

    static void dfs(long[] list, ArrayList<Long> arr, int j, long x){
        list[p++] = x;
        for(int i = j; i < arr.size(); i++){
            long y = maxn / arr.get(i);
            if(x <= y){
                y = arr.get(i) * x;
                if(y >= 0 && y <= maxn){
                    dfs(list, arr, i, y);
                }
            }
        }
        
    }
    
    public static void main(String[] args)
    {
        in = new InputReader(System.in);
        out = new PrintWriter(System.out);            
        
        int n = in.nextInt();
        ArrayList<Long> a = new ArrayList<>();
        ArrayList<Long> b = new ArrayList<>();
        
        for(int i = 0, j = 0, k = 0; i < n; i++){
            if(i < 6){
                b.add(in.nextLong());
            }
            else{
                a.add(in.nextLong());
            }
        }
        long[] tmp = new long[1000000];
        dfs(tmp, a, 0, 1);
        long[] a1 = Arrays.copyOf(tmp, p);

        p = 0;        
        dfs(tmp, b, 0, 1);
        long[] a2 = Arrays.copyOf(tmp, p);
        
        radixSort(a1);
        radixSort(a2);
        
        int k = in.nextInt();
        
        long l = 0;
        long r = (long) (1e18);
        long ans = 0;
        
        while(r - l >= 0){
            long m = (r + l) >> 1;
            int cnt = 0;
            int j = a2.length - 1;
            for(int i = 0; i < a1.length; i++){
                if(a1[i] > m) break;
                while(j >= 0 && ((a2[j] * a1[i]) > m  || ((double)(a2[j]) * a1[i]) > 1e18)){
                    j--;
                }
                cnt += j + 1;
                if(cnt >= k) break;
            }
            if(cnt >= k){
                r = m - 1;
                ans = m;
            }
            else l = m + 1;
        }
        
        out.println(ans);
        out.close();
    }
    
    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;
    }

    static class Pair implements Comparable<Pair>
    {

        int x;
        long y;

        Pair (int x,long y)
        {
                this.x = x;
                this.y = y;
        }
        public int compareTo(Pair o)
        {
            return Long.compare(this.x,o.x);
                //return 0;
        }

        public boolean equals(Object o)
        {
            if (o instanceof Pair)
            {
                Pair p = (Pair)o;
                return p.x == x && p.y==y;
            }
            return false;
        }

        @Override
        public String toString()
        {
            return x + " "+ y ;
        }

        /*public int hashCode()
        {
            return new Long(x).hashCode() * 31 + new Long(y).hashCode();
        }*/

    } 

    static long add(long a,long b){
        long x=(a+b);
        while(x>=mod) x-=mod;
        return x;
    }

    static long sub(long a,long b){
        long x=(a-b);
        while(x<0) x+=mod;
        return x;
    }
    
    static long mul(long a,long b){
        long x=(a*b);
        while(x>=mod) x-=mod;
        return x;
    }
    
    static String rev(String s){
        StringBuilder sb=new StringBuilder(s);
        sb.reverse();
        return sb.toString();
    }
    
    static long gcd(long x,long y)
    {
        if(y==0)
                return x;
        else
                return gcd(y,x%y);
    }

    static int gcd(int x,int y)
    {
        if(y==0)
                return x;
        else 
                return gcd(y,x%y);
    }

    static long pow(long n,long p,long m)
    {
         long  result = 1;
          if(p==0){
            return 1;
          }
          
        while(p!=0)
        {
            if(p%2==1)
                result *= n;
            if(result >= m)
               result %= m;
            p >>=1;
            n*=n;
            if(n >= m)
                n%=m;
        }
        
        return result;
    }

    static long pow(long n,long p)
    {
        long  result = 1;
          if(p==0)
            return 1;

        while(p!=0)
        {
            if(p%2==1)
                result *= n;	    
            p >>=1;
            n*=n;	    
        }
        return result;
    }

    static void debug(Object... o)
    {
            System.out.println(Arrays.deepToString(o));
    }

    static class InputReader
    {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream)
        {
                this.stream = stream;
        }

        public int snext()
        {
                if (snumChars == -1)
                        throw new InputMismatchException();
                if (curChar >= snumChars)
                {
                        curChar = 0;
                        try
                        {
                                snumChars = stream.read(buf);
                        } catch (IOException e)
                        {
                                throw new InputMismatchException();
                        }
                        if (snumChars <= 0)
                                return -1;
                }
                return buf[curChar++];
        }

        public int nextInt()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                int sgn = 1;
                if (c == '-')
                {
                        sgn = -1;
                        c = snext();
                }
                int res = 0;
                do
                {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public long nextLong()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                int sgn = 1;
                if (c == '-')
                {
                        sgn = -1;
                        c = snext();
                }
                long res = 0;
                do
                {
                        if (c < '0' || c > '9')
                                throw new InputMismatchException();
                        res *= 10;
                        res += c - '0';
                        c = snext();
                } while (!isSpaceChar(c));
                return res * sgn;
        }

        public int[] nextIntArray(int n)
        {
                int a[] = new int[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextInt();
                }
                return a;
        }

        public long[] nextLongArray(int n)
        {
                long a[] = new long[n];
                for (int i = 0; i < n; i++)
                {
                        a[i] = nextLong();
                }
                return a;
        }

        public String readString()
        {
                int c = snext();
                while (isSpaceChar(c))
                {
                        c = snext();
                }
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isSpaceChar(c));
                return res.toString();
        }

        public String nextLine()
        {
                int c = snext();
                while (isSpaceChar(c))
                        c = snext();
                StringBuilder res = new StringBuilder();
                do
                {
                        res.appendCodePoint(c);
                        c = snext();
                } while (!isEndOfLine(c));
                return res.toString();
        }

        public boolean isSpaceChar(int c)
        {
                if (filter != null)
                        return filter.isSpaceChar(c);
                return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c)
        {
                return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter
        {
                public boolean isSpaceChar(int ch);
        }

    }
}