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.
//SHIVAM GARG
import java.util.*;
import java.lang.*;
import java.io.*;


public class Codechef
{
 public static FastReader reader = new FastReader();
 
 
 public static void main (String[] args) throws java.lang.Exception {
	    
	    int tests = reader.nextInt();
	    int[] arr = new int[tests];
	    sieve();
        for(int ii=0; ii< tests; ii++){
            arr[ii] = reader.nextInt();
        }
        
        for(int ii=0; ii<tests; ii++){
            int temp = arr[ii];
            int a = temp+1;
            while(  primes[a] != 0){
                a = a+1;
            }
            int b = a + temp;
            while( primes[b]  != 0 ){
                b = b+1;
            }
            System.out.println(a*b);
        }
    }

    
    static int[] primes;
    
    public static void sieve(){
        primes = new int[100002]; // 0 means prime and 1 means Not prime
        int temp = 2;
        while(temp < primes.length ){
            primes[temp] = 1;
            temp = temp+2;
        }
        primes[2] = 0;
        
        for(int i = 3; i < primes.length; i = i+2){
            if(primes[i] == 0 ){
                temp = i+i;
                while(temp < primes.length ){
                    primes[temp] = 1;
                    temp = temp+i;
                }
            }
        }
    }
    
 
 
 
	
    
    
    public static HashMap<Integer, Integer> getFactors(long n){
        long ori = n;
        
        HashMap<Integer, Integer>  factors = new HashMap<Integer, Integer>();
        int temp =0;
        while(n % 2 == 0 ){
            temp++;
            n = n/2;
        }
        if(temp >0){
            factors.put(2, temp);
            // System.out.println( ori+" ==> " + 2 +" :: " + temp);
        }
        
        long sqrt = (long) Math.sqrt(n);
        for(int i= 3;(i <= sqrt) && i<=n ; i = i+2){
            if(primes[i] == 0 ){
                temp = 0;
                while(n % i == 0 ){
                    temp++;
                    n = n/i;
                }
                if(temp > 0){
                    // System.out.println( ori+" ==> " + i +" :: " + temp);
                    factors.put(i, temp);    
                }
                
            }
        }
        return factors;
        
    }
   
    
 
 /* Iterative Function to calculate  (x^y)%p in O(log y) */
 
    public static long prime = 1000000007;
    public static long[] fact;
    static long power(long x, long y) 
    { 
        // Initialize result 
        long res = 1; 
        // Update x if it is more than or 
        // equal to p 
        x = x % prime; 
                      
        while (y > 0) 
        { 
            // If y is odd, multiply x  with result 
            if (y % 2 == 1) 
                res = (res * x) % prime; 
            // y must be even now 
            y = y >> 1; // y = y/2 
            x = (x * x) % prime; 
        } 
          
        return res; 
    } 
      
    // Returns n^(-1) mod p 
    static long modInverse(long n) 
    {   return power(n, prime-2);   } 
      
    // Returns nCr % p using Fermat's little theorem. 
    static long nCrModPFermat(int n, int r) 
    { 
        // Base case 
        if (r == 0) 
            return 1; 
        long a1 = fact[n];
        long a2 = modInverse(fact[r]) % prime;
        long a3 = modInverse(fact[n-r]) % prime;
        return ((fact[n] * a2)%prime * a3) % prime; 
    } 
	
	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());  } 
        
        int[] nextIntArray(int n){
            int[] arr = new int[n];
            for(int ii=0; ii<n; ii++){
                arr[ii] = this.nextInt();
            }
            return arr;
        }
        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; 
        } 
    } 
	
	
}