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.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collections;
import java.util.InputMismatchException;
import java.util.LinkedList;

public class E {
	static long[] LLA, LLB;
	public static void main(String[] args) throws Exception {
		FinalScanner sc = new FinalScanner(); 
		PrintWriter out = new PrintWriter(System.out);
		int N =sc.nextInt();
		long[] P = sc.nextLong(N);
		long K = sc.nextLong();
		LinkedList<Long> XX = new LinkedList<Long>();
		LinkedList<Long> YY = new LinkedList<Long>();
		
		for(int a=0;a<N;a++){
			if(a%2==0){
				XX.add(P[a]);
			}
			else YY.add(P[a]);
		}
		
		LLA = MAGIC(XX);
		LLB = MAGIC(YY);
		
	//	System.out.println(Arrays.toString(LLA));
	//	System.out.println(Arrays.toString(LLB));
		long low = 0;
		long high = 1000000000000000001L;
		long mid = 42;
		long ans = -1;
		while(low<=high){
			mid = (low+high)/2L;
			if(count(mid) < K){
				ans = mid;
				low = mid+1;
			}
			else{
				high = mid-1;
			}	
		}
		out.println(ans+1);
		
		out.close();
	}

	private static long count(long X) {
		long ans = 0;
		int bp = LLB.length -1;
		stuff: for(int a=0;a<LLA.length;a++)
		{
			long LAX = X/LLA[a];
			while(LLB[bp] > LAX){
				bp--;
				if(bp<0){
					break stuff;
				}
			}
			ans += bp+1;				
		}
		
		return ans;
	}







	private static long[] MAGIC(LinkedList<Long> input) {
		LinkedList<Long> LL = new LinkedList<Long>();
		LL.add(1L);
		for(Long v : input)
		{
			LinkedList<Long> LL2 = new LinkedList<Long>();
			for(Long x : LL){
				long temp = x;
				while(1000000000000000000L / v >= temp)
				{
					temp *= v;
					LL2.add(temp);
				}				
			}
			LL.addAll(LL2);
		}
		long[] array = new long[LL.size()];
		for(int a=0;a<array.length;a++){
			array[a]=LL.pop();
		}
		Arrays.sort(array);
		
		return array;
	}







	static class FinalScanner{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		
		public FinalScanner(){
			stream = System.in;
			//stream = new FileInputStream(new File("dec.in"));

		}
		int read(){
			if(numChars==-1)
				throw new InputMismatchException();
			if(curChar>=numChars){
				curChar = 0;
				try{
					numChars = stream.read(buf);
				} catch (IOException e){
					throw new InputMismatchException();
				}
				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}
		
		boolean isSpaceChar(int c){
			return c==' '||c=='\n'||c=='\r'||c=='\t'||c==-1;
		}
		boolean isEndline(int c){
			return c=='\n'||c=='\r'||c==-1;
		}
		int nextInt(){
			return Integer.parseInt(next());
		}
		int[] nextInt(int v){
			int[] temp = new int[v];
			for(int a=0;a<v;a++)temp[a]=nextInt();
			return temp;
		}
		long nextLong(){
			return Long.parseLong(next());
		}
		long[] nextLong(int v){
			long[] temp = new long[v];
			for(int a=0;a<v;a++)temp[a]=nextLong();
			return temp;
		}
		double nextDouble(){
			return Double.parseDouble(next());
		}
		double[] nextDouble(int v){
			double[] temp = new double[v];
			for(int a=0;a<v;a++)temp[a]=nextDouble();
			return temp;
		}
		String next(){
			int c = read();
			while(isSpaceChar(c))
				c=read();
			StringBuilder res = new StringBuilder();
			do{
				res.appendCodePoint(c);
				c=read();
			} while(!isSpaceChar(c));
			return res.toString();
		}
		String[] next(int v){
			String[] temp = new String[v];
			for(int a=0;a<v;a++)temp[a]=next();
			return temp;
		}
		String nextLine(){
			int c = read();
			while(isEndline(c))
				c=read();
			StringBuilder res = new StringBuilder();
			do{
				res.appendCodePoint(c);
				c = read();
			}while(!isEndline(c));
			return res.toString();
		}
		String[] nextLine(int v){
			String[] temp = new String[v];
			for(int a=0;a<v;a++)temp[a]=nextLine();
			return temp;
		}
	}
}