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
{
	static void arrayStringPrinter(String[] S)
	{
		for(String s:S)
			System.out.print(s+" ") ;
		System.out.println() ;
	}
	public static void main(String args[]) throws Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) ;
		String s1 = br.readLine() ;
		String s2 = br.readLine() ;
		String s3 = br.readLine() ;
		int n = Integer.parseInt(s1) ;
		// System.out.println("s1 :"+s1+"\ns2 :"+s2+"\ns3 :"+s3) ;
		// Scanner in = new Scanner(System.in) ;
		// int n = in.nextInt() ;
		int[] p = new int[n] ;
		String[] s2s = s2.split(" ") ;
		// arrayStringPrinter(s2s) ;
		for(int i=0;i<n;i++)
		{
			p[i] = Integer.parseInt(s2s[i]) ;
		}
		int K = Integer.parseInt(s3) ;
		primes = new int[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 large[] = new long[(int) 2e6];//how the size was decided?
        Arrays.fill(large, Long.MAX_VALUE);//why?
        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;
        // int K = in.nextInt() ;
        small = radixSort(small);
        large = radixSort(large);
		long low = 0, high = 1000000000000000000L;//why does the answer is wrong for test case 6, for 10^{18}+7
		while(high - low > 1){//how does this exactly work
			long h = high+low>>1;
			if(count(h, small, large) >= K){
				high = h;
			}else{
				low = h;
			}
		}
		System.out.println(high) ;
		
	}
	static int[] primes ;
	static int ptr ;
	static long MAX = (long)1e18 ;
	//brute function from bhishma's submission: http://codeforces.com/contest/912/submission/34101881
	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) ;
		}
		
	}
	//count and Radix Sort from uwi's submission: http://codeforces.com/contest/912/submission/33951400
	static int count(long h,long[] left,long[] right)
	{
		int ret = 0 ;
		int p = left.length-1 ;
		// int count = 0 ;
		for(long v:right)
		{
			// count++ ;
			while(p>=0 && (v*left[p] > h || (double)v*left[p] > 1e18))
			{
				p-- ;
			}
			ret +=p+1 ;
		}
		// System.out.println("Count :"+count) ;
		return ret ;
	}
	
	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];//2^16 = 65536 
			for(int i = 0;i < n;i++)b[1+(int)(f[i]&0xffff)]++;//ffff = 65535 
			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;
	}
	
}