import java.io.*;
import java.util.*;
/**
 * Solution to Flooring Tiles
 * 
 * @author vanb
 */
public class solution1
{
    public Scanner sc;
    public PrintStream ps;
    
    public static final long biggest = 1000000000000000L;
    public static final long biggestprint = 1000000L;
    
    public long primepowers[][] = new long[100][1000];
    public boolean isprime[] = new boolean[100];
            
    /**
     * Find the minimum number that has n factors, with p as its smallest prime factor.
     *  
     * @param n Number of desired factors
     * @param p Smallest prime
     * @param square Are we looking for a perfect square?
     * @param most The must of a prime we can use.
     * @return The minimum, as stated.
     */
    public long minimum( int n, int p, boolean square, int most )
    {
        long result = biggest;
        
        if( n==1 )
        {
            result = 1L;
        }
        else
        {
            // Find the next highest prime
            int nextp = p;
            for( ++nextp; !isprime[nextp]; ++nextp );
            
            // Find factors of n
            for( int i=1; i<n; i++ ) if( n%i==0 )
            {
                int f = n/i;
                if( f-1<=most && (!square || f%2==1) )
                {
                    long possibility = primepowers[p][f-1];
                    
                    // Check and make sure the prime power isn't too big
                    if( possibility!=0 )
                    {
                        long min = minimum( i, nextp, square, f-1 );
                        
                        // Only multiply if it won't overflow.
                        if( min < biggest/possibility )
                        {
                            possibility *= min ;
                            if( possibility<result ) result = possibility;
                        }
                    }
                }
            }
        }
        return result;
    }
        
    /**
     * Driver.
     * @throws Exception
     */
    public void doit() throws Exception
    {
        sc = new Scanner( System.in ); //sc = new Scanner( new File( "flooringtiles.judge" ) );
        ps = System.out; //new PrintStream( new FileOutputStream( "flooringtiles.solution" ) ); 
            
        // Use the Sieve of Eratosthanes to discover primes
        Arrays.fill( isprime, true );
        isprime[0] = isprime[1] = false;
        
        for( int i=2; i<isprime.length; i++ ) if( isprime[i] )
        {
            // This is the sieve of Eratosthanes. If i is prime,
            // then mark 2*i, 3*i, 4*i, etc. as not prime.            
            for( int j=i+i; j<isprime.length; j+=i ) isprime[j] = false;
            
            // We'll also compute prime powers here, to save time later.
            // primepowers[i][x] will be i^x if i is prime, null otherwise.
            Arrays.fill( primepowers[i], 0L );
            primepowers[i][0] = 1L;
            for( int j=1; j<primepowers[i].length; j++ )
            {
                primepowers[i][j] = primepowers[i][j-1] * i;
                
                // Use a negative as an indication of overflow
                if( primepowers[i][j] > biggest )
                {
                    primepowers[i][j] = 0L;
                    break;
                }
            }
        }
        
        int num_cases = sc.nextInt();
        for( int i=0; i<num_cases; i++ )
        {
            int n = sc.nextInt();
            if( n==0 ) break;
            
            // If you can form n unique rectangles with x little boxes, then there
            // must be n factors of x less than or equal to its square root. So, there are
            // two cases - either it has 2n total factors, or it's a perfect square 
            // and it has 2n-1 factors. We'll compute both, and take the smaller of the two.
            long answer = Math.min( minimum( n+n, 2, false, n+n ), minimum( n+n-1, 2, true, n+n ) );
            if( answer > biggestprint )
                ps.println( "Too big" );
            else
                ps.println( answer );
        }
    }
    
    public static void main( String[] args ) throws Exception
    {
        new solution1().doit(); 
    }
}
