Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
life = list(map(int, input().split()))
while len(life) >1:
    life.sort()
    if life[0] == 1 : break
    life_array = [life[0]] + [i%life[0] for i in life if i%life[0] !=0]
    life = []
    for i in life_array:
        if i not in life:
            life.append(i)
 
print(life[0])

Fixed submission:
N = int(input())
life = list(map(int, input().split()))
while len(life) >1:
    life.sort()
    life_array = [life[0]] + [i%life[0] for i in life if i%life[0] !=0]
    life = life_array
    #for i in life_array:
        #if i not in life:
            #life.append(i)
 
print(life[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
life = list(map(int, input().split()))
min = 1000000000000
while len(life) >1:
    life = list(set(life))
    for i in life:
        if i < min: min = i
    
    life_array=[]
    for i in life:
        if i%min != 0 and i not in life_array: life_array.append(i%min)
    life = [min] + life_array

print(life[0])

Fixed submission:
N = int(input())
life = list(map(int, input().split()))
while len(life) >1:
    life.sort()
    life_array = [life[0]] + [i%life[0] for i in life if i%life[0] !=0]
    life = life_array
    #for i in life_array:
        #if i not in life:
            #life.append(i)
 
print(life[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
life = list(map(int, input().split()))
min = 1000000000000
while len(life) >1:
    for i in life:
        if i < min: min = i
    life_array=[]
    for i in life:
        if i%min != 0 and i not in life_array: life_array.append(i%min)
    life = [min] + life_array

print(life[0])

Fixed submission:
N = int(input())
life = list(map(int, input().split()))
while len(life) >1:
    life.sort()
    life_array = [life[0]] + [i%life[0] for i in life if i%life[0] !=0]
    life = life_array
    #for i in life_array:
        #if i not in life:
            #life.append(i)
 
print(life[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
life = list(map(int, input().split()))
while len(life) >1:
    life.sort()
    life_array=[]
    for i in life:
        if i%life[0] != 0 and i not in life_array: life_array.append(i%life[0])
    life = [life[0]] + life_array

print(life[0])

Fixed submission:
N = int(input())
life = list(map(int, input().split()))
while len(life) >1:
    life.sort()
    life_array = [life[0]] + [i%life[0] for i in life if i%life[0] !=0]
    life = life_array
    #for i in life_array:
        #if i not in life:
            #life.append(i)
 
print(life[0])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
life = list(map(int, input().split()))
while len(life) >1:
    life.sort()
    life_array = [life[0]] + [i%life[0] for i in life if i%life[0] !=0]
    life = []
    for i in life_array:
        if i not in life:
            life.append(i)

print(life[0])

Fixed submission:
N = int(input())
life = list(map(int, input().split()))
while len(life) >1:
    life.sort()
    life_array = [life[0]] + [i%life[0] for i in life if i%life[0] !=0]
    life = life_array
    #for i in life_array:
        #if i not in life:
            #life.append(i)
 
print(life[0])