Now Flash is in  serious trouble. Both Reverse_flash and Zoom are on their way to attack him. But Flash's energy is not enough to face them. Our all time genius Harrison Wells had created a replica mixture and gave it to Flash. Now Flash got 'N' replicas of himself including him. This would have helped him to face them with the help of his replicas. But due to some chemical contamination all the replicas including original Flash were given a specific  time interval to attack. They could face Reverse_flash and Zoom only if they(replicas) attack in unity.
Now to test their attacks the replicas have already started attacks at t=0; Now your task is to guess the next time , other than t=0, when all the replicas could attack at once . So that you could ask Zoom and his friend to attack at that particular time :)
Input constraints
1st line --> T (1 ≤ T ≤ 10) =Test cases
T test cases follow:
1st line -->Integer 'N' (1 ≤ N ≤ 1000) denoting the total no. of replicas including Original Flash.
Next line contains N space separated integers denoting the time intervals 'ti' (1 ≤ ti ≤ 10000) of attacks of N replicas(including Flash).
Output constraints
T lines --> each containing one integer denoting the answer to the above ques(modulo 1000000007).

SAMPLE INPUT
1
4
1 2 3 1

SAMPLE OUTPUT
6

Explanation

There are 4 Replicas including Flash.
The attack started at t=0 i.e, everyone attacked at once for once.
Now for everyone will be able to attack again at once only at t=6. Find it yourself.
def gcd(a,b) :
	if b == 0 :
		return a
	return gcd(b,a%b)
	
T=int(raw_input())
for t in range(T) :
	N=int(raw_input())
	timeint=[int(i) for i in raw_input().split()]
	i=1
	lcm=timeint[0]
	while i<N :
		lcm=(lcm*timeint[i])/gcd(lcm,timeint[i])
		i=i+1
	print lcm%1000000007