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.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
import java.util.StringTokenizer;
/*

16
2 3 5 7 11 13 17 19 23 29 31 37 41
43
47
53
700000000

*/
public class c {
	static long MAX = (long) 1e18;
	public static void main(String[] args) throws IOException {
		FastScanner in = new FastScanner(System.in);
		int n = in.nextInt();
		int[] ps1 = new int[(n+1)/2], ps2 = new int[n/2];
		for(int i=0;i<n;i++) {
			if((i % 2) == 0)
				ps1[i/2] = in.nextInt();
			else
				ps2[i/2] = in.nextInt();
		}
		long k = in.nextLong();
		List nums1 = new List(), nums2 = new List();
		bf(ps1, nums1, 0, 1L);
		bf(ps2, nums2, 0, 1L);
		lsbRadixSort(nums1.vs, nums1.size, true);
		lsbRadixSort(nums2.vs, nums2.size, true);
		long lo = k, hi = MAX;
		while(lo < hi) {
			long mid = lo+hi>>1;
			int j = nums2.size;
			long cnt = 0;
			for(int i=0;i<nums1.size;i++) {
				while(j != 0 && !multLTE(nums1.vs[i],nums2.vs[j-1],mid))
					j--;
				cnt += j;
			}
			if(cnt < k)
				lo = mid+1;
			else if(cnt > k)
				hi = mid-1;
			else
				hi = mid;
		}
		System.out.println(lo);
	}
	static boolean multLTE(long x, long y, long max) {
		return x<=max/y;
	}
	static void bf(int[] ps, List nums, int idx, long v) {
		nums.add(v);
		for(int i=idx;i<ps.length;i++) {
			if(!multLTE(v, ps[i], MAX))
				break;
			bf(ps, nums, i, v*ps[i]);
		}
	}
	static class List {
		int size;
		long[] vs;
		public List() {
			vs = new long[1119429];
		}
		public void add(long x) {
			vs[size++] = x;
		}
	}
	static void lsbRadixSort(long[] a, int n, boolean signed) {
		int s = 0;
		int[] p = new int[257];
		long[] b = new long[n];
		long sb = 1L << 63;
		if(signed) for(int i=0;i<n;i++)  a[i] ^= sb;
		while (s < 64) {
			Arrays.fill(p, 0);
			for (int i = 0; i < n; i++)
				p[(int) (((a[i] >>> s) & 255)+1)]++;
			for(int i=2;i<256;i++)
				p[i] += p[i-1];
			for (int i = 0; i < n; i++)
				b[p[(int) ((a[i] >>> s) & 255)]++] = a[i];
			long[] tmp = b;  b = a;  a = tmp;
			s += 8;
		}
		if(signed) for(int i=0;i<n;i++)  a[i] ^= sb;
	}
	static class FastScanner {
	    BufferedReader br;
	    StringTokenizer st;
	    public FastScanner(InputStream i) {
	        br = new BufferedReader(new InputStreamReader(i));
	        st = new StringTokenizer("");
	    }
	    public String next() throws IOException {
	        if(st.hasMoreTokens())
	            return st.nextToken();
	        else
	            st = new StringTokenizer(br.readLine());
	        return next();
	    }
	    public int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    public long nextLong() throws IOException {
	        return Long.parseLong(next());
	    }
	    public double nextDouble() throws IOException {
	        return Double.parseDouble(next());
	    }
	}
}