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 Test{
	InputStream is;
	PrintWriter out;

	String INPUT = "2 41 61 66";
	long[] temp = new long[1000000];
	int ind;
	void solve()
	{
		//out.println(new Pair(2,3).equals(new Pair(2,3)));
		int n = ni();
		int[] a = na(n);
		long k = nl();

		int[] odd = new int[n];
		int[] even = new int[n];
		{
			int in = 0;
			for(int i = 0 ; i < n ; i++)
			{
				if(i%4==0 || i%4==3)
				{
					odd[in++] = a[i];
				}
			}
			odd = Arrays.copyOf(odd,in);
		}
		{
			int in = 0;
			for(int i = 0 ; i < n ; i++)
			{
				if((i%4) == 1 || i%4 ==2)
				{
					even[in++] = a[i];
				}
			}
			even = Arrays.copyOf(even,in);
		}
		ind = 0;
		dfs_generate(odd,0,1L);
		long[] lrs = Arrays.copyOf(temp,ind);

		ind = 0;
		dfs_generate(even,0,1L);
		long[] rrs = Arrays.copyOf(temp,ind);

		Merge.sort(lrs);
		Merge.sort(rrs);
		
		long l = 0 , r = (long)1e18+10;
		while(r-l>1)
		{
			long x = (r+l)>>1;
			if(count(x,lrs,rrs)>=k)
				r = x;
			else
				l = x;
		}
		out.println(r);



	}
	private long count(long x,long[] l,long[] r)
	{
		int p = l.length-1;
		long ans = 0;
		for(long v: r)
		{
			while(p>=0 && ((double)v*l[p] >1e18 ||v*1L*l[p]>x ))
				p--;
			ans+=(p+1);
		}
		return ans;
	}
	private void dfs_generate(int[] a ,int index,long val)
	{	
		temp[ind++] = val;
		for(int i = index ; i < a.length; i++)
		{
			if((double)val*a[i] < 1.05e18)
			{
				dfs_generate(a,i,val*a[i]);
			}
			else
			{
				break;
			}
		}
	}
	static class Merge 
        {

                public static void sort(long inputArr[]) 
                {
                        int length = inputArr.length;
                        doMergeSort(inputArr,0, length - 1);
                }

                private static void doMergeSort(long[] arr,int lowerIndex, int higherIndex) {        
                        if (lowerIndex < higherIndex) {
                            int middle = lowerIndex + (higherIndex - lowerIndex) / 2;
                            doMergeSort(arr,lowerIndex, middle);
                            doMergeSort(arr,middle + 1, higherIndex);
                            mergeParts(arr,lowerIndex, middle, higherIndex);
                        }
                }

                private static void mergeParts(long[]array,int lowerIndex, int middle, int higherIndex)
                {
                        long[] temp=new long[higherIndex-lowerIndex+1];
                        for (int i = lowerIndex; i <= higherIndex; i++) {
                                temp[i-lowerIndex] = array[i];
                        }
                        int i = lowerIndex;
                        int j = middle + 1;
                        int k = lowerIndex;
                        while (i <= middle && j <= higherIndex) {
                                if (temp[i-lowerIndex] < temp[j-lowerIndex])
                                {
                                        array[k] = temp[i-lowerIndex];
                                        i++;
                                } 
                                else
                                {
                                        array[k] = temp[j-lowerIndex];
                                        j++;
                                }
                                k++;
                        }
                        while (i <= middle) {
                                array[k] = temp[i-lowerIndex];
                                k++;
                                i++;
                        }
                        while(j<=higherIndex){
                                array[k]=temp[j-lowerIndex];
                                k++;
                                j++;
                        }
                }
        }
	///////////////////////////////////////
	void run() throws Exception{
		// Random r = new Random();
		// StringBuilder sb = new StringBuilder();
		// sb.append("")
		is = oj ? System.in: new ByteArrayInputStream(INPUT.getBytes());
		//is = System.in;
		long s = System.currentTimeMillis();

		out = new PrintWriter(System.out);
		solve();

		
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}
	public static void main(String[] args)throws Exception {
		new Test().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	
	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	
	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }
	
	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}
		
		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	
	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}