def gcd(x, y):
    if(y > x):
        tmp = y
        y = x
        x = tmp

    while(int(x%y)>0):
        r = x%y
        x = y
        y = r

    return y
        


n = int(input())
a = list(map(int, input().split()))

ans = gcd(a[0], a[1])
for i in range(1, n-1):
    ans = min(ans, gcd(a[i], a[i+1]))

print(ans) def gcd(x, y):
    if(y > x):
        tmp = y
        y = x
        x = tmp

    while(int(x%y)>0):
        r = x%y
        x = y
        y = r

    return y
         gcd if(y > x):
        tmp = y
        y = x
        x = tmp

     y > x y x tmp = y tmp y y = x y x x = tmp x tmp while(int(x%y)>0):
        r = x%y
        x = y
        y = r

     int(x%y)>0 int(x%y) int x%y x y 0 r = x%y r x%y x y x = y x y y = r y r return y y x x y y n = int(input()) n int(input()) int input() input a = list(map(int, input().split())) a list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = gcd(a[0], a[1]) ans gcd(a[0], a[1]) gcd a[0] a 0 a[1] a 1 for i in range(1, n-1):
    ans = min(ans, gcd(a[i], a[i+1])) i range(1, n-1) range 1 n-1 n 1 ans = min(ans, gcd(a[i], a[i+1])) ans min(ans, gcd(a[i], a[i+1])) min ans gcd(a[i], a[i+1]) gcd a[i] a i a[i+1] a i+1 i 1 print(ans) print ans a = list(map(int, input().split())) list(map(int, input().split())) a ans = min(ans, gcd(a[i], a[i+1])) min(ans, gcd(a[i], a[i+1])) ans ans = gcd(a[0], a[1]) gcd(a[0], a[1]) ans n = int(input()) int(input()) n def gcd(x, y):
    if(y > x):
        tmp = y
        y = x
        x = tmp

    while(int(x%y)>0):
        r = x%y
        x = y
        y = r

    return y
         def gcd(x, y):
    if(y > x):
        tmp = y
        y = x
        x = tmp

    while(int(x%y)>0):
        r = x%y
        x = y
        y = r

    return y
         gcd
def gcd(x, y):
    if(y > x):
        tmp = y
        y = x
        x = tmp

    while(int(x%y)>0):
        r = x%y
        x = y
        y = r

    return y
        


n = int(input())
a = list(map(int, input().split()))

ans = gcd(a[0], a[1])
for i in range(1, n-1):
    ans = min(ans, gcd(a[i], a[i+1]))

print(ans)