Ksusha is a beginner coder. Today she starts studying arrays. She has array *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>, consisting of *n* positive integers.

Her university teacher gave her a task. Find such number in the array, that all array elements are divisible by it. Help her and find the number!
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>), showing how many numbers the array has. The next line contains integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (1 ≤ *a*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">9</sup>) — the array elements.
'''
╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
╬╬        ▓▓     ▓▓      ╬╬
╬╬        ▓▓     ▓▓      ╬╬
╬╬        ▓▓█████▓▓      ╬╬
╬╬        ▓▓     ▓▓      ╬╬
╬╬        ▓▓     ▓▓      ╬╬
╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
###########################

// •︿• \\
/\\    //\
 /\\  //\
  /\\//\

###########################
'''
import sys
import math as mth
from math import ceil as cl
from math import log2 as l2
from math import factorial as fct
from collections import Counter as CNT
from math import log
from math import floor as fl
mod = 10**9 + 7
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
def ii():
    return int(input())
def fi():
    return float(input())
def lii():
    return list(map(int, input().split()))
def ss():
    return input()
def lss():
    return input().split()
def yes():
    print("YES")
def no():
    print("NO")
############################################
input = lambda : sys.stdin.readline().strip()
'''
╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬╬
'''
def gcd_of_array(arr):
    x = arr[0]
    for i in arr:
        x = mth.gcd(x,i)
    return x
n = ii()
arr = lii()
g = gcd_of_array(arr)
ans = -1
for i in arr:
    if g%i == 0 :
        ans = i
        break
print(ans)
