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:
/*
 * Author Ayub Subhaniya
 * Institute DA-IICT
 */

import java.io.*;
import java.math.*;
import java.util.*;

public class A
{
	
	InputStream in;
	PrintWriter out;

	int MAX=(int)1e7;
	long M=(long)1e18;
	void solve() 
	{
		int n=ni();
		long p[]=new long[n];
		for (int i=0;i<n;i++)
			p[i]=nl();
		
		long k=nl();
		if (n==1)
		{
			long ans=1;
			for (int i=1;i<k;i++)
				ans*=p[0];
			if (ans<0)
				ans=M;
			out.println(ans);
			return;
		}
		long arr1[]=new long[MAX];
		long arr2[]=new long[MAX];
		int sz1,sz2;
		
		sz1=sz2=0;
		long mul1=1;
		
		/*for (int i=0;i<sz;i++)
			mul1*=p[i];*/
		arr1[sz1++]=mul1;
		
		/*if (mul1>mid)
		{
			l=mid+1;
			continue;
		}*/
		
		long mul=mul1;
		while (true)
		{
			if (M/p[0]<=mul)
				break;
			
			mul*=p[0];
			arr1[sz1++]=mul;
		}
		
		for (int i=2;i<n;i+=2)
		{
			int m=sz1;
			for (int j=0;j<m;j++)
			{
				mul=arr1[j];
				while (true)
				{
					if (M/p[i]<=mul)
						break;
					mul*=p[i];
					arr1[sz1++]=mul;
				}
			}
		}
		
		long mul2=1;
		
		/*for (int i=sz;i<n;i++)
			mul2*=p[i];*/
		arr2[sz2++]=mul2;
		
		/*if (mul2>mid)
		{
			l=mid+1;
			continue;
		}*/
		mul=mul2;
		while (true)
		{
			if (M/p[1]<=mul)
				break;
			mul*=p[1];
			arr2[sz2++]=mul;
		}
		
		for (int i=3;i<n;i+=2)
		{
			int m=sz2;
			for (int j=0;j<m;j++)
			{
				mul=arr2[j];
				while (true)
				{
					if (M/p[i]<=mul)
						break;
					mul*=p[i];
					arr2[sz2++]=mul;
				}
			}
		}
		Arrays.sort(arr1,0,sz1);
		Arrays.sort(arr2,0,sz2);
		tr(sz1,sz2);
		
		long l=1,r=(long)1e18,result=r;
		while (l<=r)
		{
			long mid=((l+r)>>1);
			
			long rank=0;
			int s1=0,s2=sz2-1;
			
			while (s1<sz1&&s2>=0)
			{
				if (arr1[s1]<=mid/arr2[s2])
				{
					rank+=s2+1;
					s1++;
				}
				else
					s2--;
			}
			
			if (rank>=k)
			{
				result=mid;
				r=mid-1;
			}
			else
				l=mid+1;
			
			//tr(mid,rank,"**************");
		}
		out.println(result);
	}
	
	int max(int a,int b)
	{
		if(a>b)
			return a;
		else
			return b;
	}
	
	int min(int a,int b)
	{
		if(a>b)
			return b;
		else 
			return a;
	}
	
	long max(long a,long b)
	{
		if(a>b)
			return a;
		else
			return b;
		
	}
	
	
	long min(long a,long b)
	{
		if(a>b)
			return b;
		else 
			return a;
		
	}
		
	void run() throws Exception 
	{
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);
		
		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis() - s + "ms");
		
	}
	public static void main(String[] args) throws Exception 
	{
		new A().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 = in.read(inbuf);
			}
			catch (IOException e) 
			{
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}
	
	private boolean inSpaceChar(int c) 
	{
		return !(c >= 33 && c <= 126);
	}
	
	private int skip() 
	{
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(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 (!(inSpaceChar(b))) 
		{ // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	
	private char[] ns(int n) 
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b))) 
		{
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	
	private char[][] nm(int n, int m) 
	{
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}
	
	private int[] na(int n) 
	{
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	
	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 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));
	}
	
}