Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    M = [mini] + [x-mini for x in M[1:] if x % mini != 0]
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(mini)    


Fixed submission:
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    M = [mini] + [x%mini for x in M[1:] if x % mini != 0]
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(M[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    for i,x in enumerate(M):
        M = [mini] + [x for x in M[1:] if x % mini != 0]
    M = list(map(lambda x:x-mini,M))
    M[0] = mini
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(mini)


Fixed submission:
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    M = [mini] + [x%mini for x in M[1:] if x % mini != 0]
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(M[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
for i,x in enumerate(M):
    M = [mini] + [x for x in M[1:] if x % mini != 0]
            
while len(M) > 1:
    M = list(map(lambda x:x-mini,M))
    M[0] = mini
    M.sort()
    if 1 in M:
        mini=1
        break
#    while M[0]<1:
#        M.pop(0)
    mini = min(mini,M[0])
print(mini)    


Fixed submission:
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    M = [mini] + [x%mini for x in M[1:] if x % mini != 0]
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(M[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
for i,x in enumerate(M):
    M = [mini] + [x for x in M[1:] if x % mini != 0]
            
while len(M) > 1:
    if 1 in M:
        mini=1
        break
    M = list(map(lambda x:x-mini,M))
    M[0] = mini
    M.sort()
    while M[0]<1:
        M.pop(0)
    mini = min(mini,M[0])
print(mini)    


Fixed submission:
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    M = [mini] + [x%mini for x in M[1:] if x % mini != 0]
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(M[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
for i,x in enumerate(M):
    M = [mini] + [x for x in M[1:] if x % mini != 0]
            
while len(M) > 1:
    if 1 in M:
        mini=1
        break
    M = [M[0]] + [x-mini for x in M[1:]]
    M.sort()
    while M[0]<1:
        M.pop(0)
    mini = min(mini,M[0])
print(mini)    


Fixed submission:
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    M = [mini] + [x%mini for x in M[1:] if x % mini != 0]
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(M[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
while len(M) > 1:
    if 1 in M:
        mini=1
        break
    M = [M[0]] + [x-mini for x in M[1:]]
    M.sort()
    while M[0]<1:
        M.pop(0)
    mini = min(mini,M[0])
print(mini)    


Fixed submission:
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    M = [mini] + [x%mini for x in M[1:] if x % mini != 0]
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(M[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
while len(M) > 1:
    if 1 in M:
        mini=1
        break
    M = [M[0]] + [M[x]-mini for x in range(1,len(M))]
    M.sort()
    M = [x for x in M if x >= 1]
    mini = min(mini,M[0])
print(mini)    


Fixed submission:
N = int(input())
An = [int(n) for n in input().split()]
M = sorted(set(An))
mini=M[0]
            
while len(M) > 1:
    M = [mini] + [x%mini for x in M[1:] if x % mini != 0]
    M.sort()
    if 1 in M:
        mini=1
        break
    mini = min(mini,M[0])
print(M[0])