N = int(input())
A = list(sorted(list(set(map(int, input().split())))))
while True:
    n = len(A)
    if n == 1 or A[0] == 1:
        break
    B = {A[0]}
    for j in range(1, n):
        m = A[j] % A[0]
        if m != 0:
            B.add(m)
    A = list(sorted(list(B)))
print(A[0]) N = int(input()) N int(input()) int input() input A = list(sorted(list(set(map(int, input().split()))))) A list(sorted(list(set(map(int, input().split()))))) list sorted(list(set(map(int, input().split())))) sorted list(set(map(int, input().split()))) list set(map(int, input().split())) set map(int, input().split()) map int input().split() ().split () input split while True:
    n = len(A)
    if n == 1 or A[0] == 1:
        break
    B = {A[0]}
    for j in range(1, n):
        m = A[j] % A[0]
        if m != 0:
            B.add(m)
    A = list(sorted(list(B))) True n = len(A) n len(A) len A if n == 1 or A[0] == 1:
        break
     n == 1 or A[0] == 1 n == 1 n 1 A[0] == 1 A[0] A 0 1 break B = {A[0]} B {A[0]} for j in range(1, n):
        m = A[j] % A[0]
        if m != 0:
            B.add(m)
     j range(1, n) range 1 n m = A[j] % A[0] m A[j] % A[0] A[j] A j A[0] A 0 if m != 0:
            B.add(m)
     m != 0 m 0 B.add(m) B.add B add m A = list(sorted(list(B))) A list(sorted(list(B))) list sorted(list(B)) sorted list(B) list B print(A[0]) print A[0] A 0 m = A[j] % A[0] A[j] % A[0] m n = len(A) len(A) n A = list(sorted(list(B))) list(sorted(list(B))) A N = int(input()) int(input()) N A = list(sorted(list(set(map(int, input().split()))))) list(sorted(list(set(map(int, input().split()))))) A B = {A[0]} {A[0]} B
N = int(input())
A = list(sorted(list(set(map(int, input().split())))))
while True:
    n = len(A)
    if n == 1 or A[0] == 1:
        break
    B = {A[0]}
    for j in range(1, n):
        m = A[j] % A[0]
        if m != 0:
            B.add(m)
    A = list(sorted(list(B)))
print(A[0])
