/**
 * Sample solution to Jackpot
 * Author: Stein Norheim
 *
 *
 */

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

class Primes {
    public int[] primes;
    public int[] pfactor;
    
    public int n;

    public Primes(int maxPrime) {
        primes = new int[maxPrime];
        pfactor = new int[maxPrime+1];
        primes[0]=2;
        pfactor[1]=1;
        n=1;

        int i;
        int j;

        for (i=2; i<=maxPrime; i++) {
            for (j=0; (j<n) && (i%primes[j]!=0); j++);
            if (j==n) {
                primes[n++]=i;
                pfactor[i]=i;
            } else {
                pfactor[i]=primes[j];
            }
            
        }
    }
};

class Jackpot {
   
    static BufferedReader stdin = 
	new BufferedReader(new InputStreamReader(System.in));

    static StreamTokenizer tokens;
    
    static PrintWriter stdout = 
	new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    static int getInt() throws IOException
    {
	tokens.nextToken();
	return Integer.parseInt(tokens.sval);
    }

    public static void main(String[] as)  throws IOException
    {
        init();
        Primes p=new Primes(1000);
        int N = getInt();
        int[] factors = new int[1000];
        int nfactors;
        
        for (int i=0; i<N; i++) {
            nfactors=0;
            
            int nWheels = getInt();
            int periodicity;
            
            for (int j=0; j<nWheels; j++) {
                periodicity = getInt();
                for (int k=0; k<nfactors; k++) {
                    if (periodicity % factors[k]==0)
                        periodicity = periodicity/factors[k];
                }
                while (periodicity>1) {
                    int primefactor = p.pfactor[periodicity];
                    factors[nfactors++]=primefactor;
                    periodicity /= primefactor;
                }
            }
            int fullperiodicity=1;
            for (int j=0; j<nfactors; j++) {
                if ((fullperiodicity*factors[j])/(factors[j])==fullperiodicity)
                    fullperiodicity*=factors[j];
                else {
                    fullperiodicity=-1;
                    break;
                }
            }

            if (fullperiodicity==-1 || fullperiodicity>1000000000)
                System.out.println("More than a billion.");
            else
                System.out.println(fullperiodicity);
        }
        stdout.close();
    }

    
    static void solve() throws IOException
    {
        
    }
    
    
    static void init() 
    {
        tokens = new StreamTokenizer(stdin);
        tokens.resetSyntax();
        tokens.whitespaceChars(0,32);
        tokens.wordChars(33,255);
    }
    

}

	    
