Positive integer x is called divisor of positive integer y, if y is divisible by x without remainder. For example, 1 is a divisor of 7 and 3 is not divisor of 8.

We gave you an integer d and asked you to find the smallest positive integer a, such that 

  * a has at least 4 divisors; 
  * difference between any two divisors of a is at least d.

Input

The first line contains a single integer t (1 ≤ t ≤ 3000) — the number of test cases.

The first line of each test case contains a single integer d (1 ≤ d ≤ 10000).

Output

For each test case print one integer a — the answer for this test case.

Example

Input


2
1
2


Output


6
15

Note

In the first test case, integer 6 have following divisors: [1, 2, 3, 6]. There are 4 of them and the difference between any two of them is at least 1. There is no smaller integer with at least 4 divisors.

In the second test case, integer 15 have following divisors: [1, 3, 5, 15]. There are 4 of them and the difference between any two of them is at least 2.

The answer 12 is INVALID because divisors are [1, 2, 3, 4, 6, 12]. And the difference between, for example, divisors 2 and 3 is less than d=2.
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.util.*;
 
public class B {
	private static final FastReader fs = new FastReader();
	private static final PrintWriter out = new PrintWriter(System.out);
	private static boolean[] mark;
	private static TreeSet<Long> primes;
	private static final int mxn = (int)1e5+1;
	
	private static void preCal() {
		mark = new boolean[mxn];
		primes = new TreeSet<>();
		Arrays.fill(mark, true);
		for(int i = 2; i*i < mxn; i++) {
			if(mark[i]) {
				for(int j = i*i; j<mxn; j+=i)
					mark[j] = false;
			}
		}
		for(int i = 2; i<mxn; i++)
			if(mark[i])
				primes.add(i*1l);
				
	}
 
	private static void solve() {
		int d = fs.nextInt();
		long num = 1;
		long last = 1;
		for(int i = 1; i<3; i++) {
			last = primes.ceiling(last+d);
			num *= last;
		}
		out.println(num);
	}
 
	public static void main(String[] args) {
		Thread t = new Thread(null, null, "", 1 << 28) {
			public void run() {
				int test_case = 1;
				preCal();
				test_case = fs.nextInt();
				for (int cs = 1; cs <= test_case; cs++) {
					solve();
				}
				out.close();
			}
		};
		t.start();
		try {
			t.join();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
 
	private static class FastReader {
		BufferedReader br;
		StringTokenizer st;
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
 
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return str;
		}
 
		int[] readintarray(int n) {
			int res[] = new int[n];
			for (int i = 0; i < n; i++)
				res[i] = nextInt();
			return res;
		}
 
		long[] readlongarray(int n) {
			long res[] = new long[n];
			for (int i = 0; i < n; i++)
				res[i] = nextLong();
			return res;
		}
	}
 
	public static class pair<T1 extends Comparable<T1>, T2 extends Comparable<T2>> implements Comparable<pair<T1, T2>> {
		T1 ff;
		T2 ss;
 
		public pair(T1 ff, T2 ss) {
			this.ff = ff;
			this.ss = ss;
		}
 
		public int compareTo(pair<T1, T2> o) {
			if (ff == o.ff)
				return ss.compareTo(o.ss);
			return ff.compareTo(o.ff);
		}
	}
 
	private static class cf {
		public static long power(long base, long exponent) {
			long res = 1;
			while (exponent > 0) {
				if (exponent % 2 == 1)
					res *= base;
				exponent >>= 1;
				base *= base;
			}
			return res;
		}
 
		public static long mul(long a, long b, long mod) {
			return (a % mod * b % mod) % mod;
		}
 
		public static long add(long a, long b, long mod) {
			return (a % mod + b % mod) % mod;
		}
 
		public static long sub(long a, long b, long mod) {
			return ((a % mod - b % mod) % mod + mod) % mod;
		}
 
		public static long power(long base, long exponent, long mod) {
			long res = 1;
			base %= mod;
			while (exponent > 0) {
				if (exponent % 2 == 1)
					res = mul(res, base, mod);
				exponent >>= 1;
				base = mul(base, base, mod);
			}
			return res;
		}
 
		public static void sortIntArray(int[] a) {
			ArrayList<Integer> tmp = new ArrayList<>();
			for (int x : a)
				tmp.add(x);
			Collections.sort(tmp);
			for (int i = 0; i < tmp.size(); i++)
				a[i] = tmp.get(i);
		}
 
		public static void sortLongArray(long[] a) {
			ArrayList<Long> tmp = new ArrayList<>();
			for (long x : a)
				tmp.add(x);
			Collections.sort(tmp);
			for (int i = 0; i < tmp.size(); i++)
				a[i] = tmp.get(i);
		}
 
		public static <T extends Comparable<T>> void sort(T[] a) {
			ArrayList<T> tmp = new ArrayList<>();
			for (T x : a)
				tmp.add(x);
			Collections.sort(tmp);
			for (int i = 0; i < tmp.size(); i++)
				a[i] = tmp.get(i);
		}
 
		public static int __gcd(int a, int b) {
			return b == 0 ? a : __gcd(b, a % b);
		}
 
		public static long __gcd(long a, long b) {
			return b == 0 ? a : __gcd(b, a % b);
		}
 
		public static int max(int[] a) {
			int mx = a[0];
			for (int ele : a) {
				mx = Math.max(mx, ele);
			}
			return mx;
		}
 
		public static long max(long[] a) {
			long mx = a[0];
			for (long ele : a) {
				mx = Math.max(mx, ele);
			}
			return mx;
		}
 
		public static int min(int[] a) {
			int mn = a[0];
			for (int ele : a) {
				mn = Math.min(mn, ele);
			}
			return mn;
		}
 
		public static long min(long[] a) {
			long mn = a[0];
			for (long ele : a) {
				mn = Math.min(mn, ele);
			}
			return mn;
		}
	}
}