Problem: Well Jamun is very proud of the way he knows everything ( or at least thinks so ).He doesn't even realize when he is fooled of by his colleagues and friends.
Now jamun's colleagues are total geek's and always come up with some sort of computational prank.But this time they try something new.
As Jamun is waving about how they all are wasting their future, they ask him for helping to figure out a problem. The problem is as follows : 

N children's are sitting in a line and everyone has picked up Xi number of sweets from the sweet basket.As all the children's have unequal number of sweets they get jealous of each other and riots come up.Now Jamun's colleagues are given instructions that they have to make things right and that also in a playful way.They have been instructed that in every round of the play they have to pick up any 2 children with unequal sweets , and compare sweets they have.The kid having the larger number of sweets is then given the difference of the two.

For example, if one kid has 2 and the other has 5. Then the kid with 5 sweets is replaced by (5-2)=3 sweets.Now the kids have 2,3 sweets each.

This is done until all children's have equal number of sweets.
Now Jamun and his colleagues being as lazy as they are, want to know what will this final number for which the every kid have equal number of sweets.

(See the Sample Test Cases for Clarification. )

But even this problem proves too hard for them and Jamun asks your help to find out the answer.

Input

The first line of the input contains an integer T, the number of test cases. Then follow the description of T test cases. 
The first line of each test case contains a single integer N, the number of children.
The second line contains N space-separated positive integers, denoting the number of sweets each children has.

Output

For each test case, output a line having a single integer - the final number of sweets each kid has.

Constraints

1 ≤ T ≤ 336

1 ≤ N ≤ 1000

1 ≤ S[i] ≤ 10^9

Problem Setter : Shikhar Singh

SAMPLE INPUT
2
3
5 15 10
3 
3 1 2

SAMPLE OUTPUT
5
1

Explanation

Case 1:

(5,15) are picked-> 15 replaced by (15-5) = 10 -> new configuration 5 10 10
(5,10) are picked-> 10 replaced by (10-5) = 5 -> new configuration 5 10 5
(10,5) are picked-> 10 replaced by (10-5) = 5 -> new configuration 5 5 5

Final answer is 5.

Solution (in PYTHON):

Solution:
def gcd(x,y):
	a=max(x,y)
	b=min(x,y)
	while(b):
		temp=b
		b=a%b
		a=temp
	return a
for i in xrange(input()):
	n=input()
	p=map(int,raw_input().split())
	x=p[0]
	for j in xrange(1,n):
		x=gcd(x,p[j])
	print x