from collections import Counter





def factor(N):

    ret = []

    i = 2

    while N > 1:

        if N % i == 0:

            ret.append(i)

            N //= i

        else:

            i += 1

    return ret





def solve(N, As):

    iter = Counter(factor(min(As)))



    for a in As:

        for k, v in list(iter.items()):

            if a % k != 0:

                iter[k] = 0

            else:

                count = 0

                kk = k

                while a % kk == 0:

                    kk *= k

                    count += 1

                iter[k] = min(v, count)

    d = 1

    for k, v in list(iter.items()):

        if v != 0:

            d *= k ** v

    return d



if __name__ == "__main__":

    N = int(eval(input()))

    As = list(map(int, input().split(" ")))

    print((solve(N, As)))



def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)



assert (gcd(10, 3) == 1)



def solve(N, As):

    k = min(As)

    for a in As:

        k = gcd(k, a)

    return k



if __name__ == "__main__":

    N = int(eval(input()))

    As = list(map(int, input().split(" ")))

    print((solve(N, As)))

from collections import Counter


def factor(N):
    ret = []
    i = 2
    while N > 1:
        if N % i == 0:
            ret.append(i)
            N //= i
        else:
            i += 1
    return ret


def solve(N, As):
    iter = Counter(factor(min(As)))
    for a in As:
        for k, v in list(iter.items()):
            if a % k != 0:
                iter[k] = 0
            else:
                count = 0
                kk = k
                while a % kk == 0:
                    kk *= k
                    count += 1
                iter[k] = min(v, count)
    d = 1
    for k, v in list(iter.items()):
        if v != 0:
            d *= k**v
    return d


if __name__ == "__main__":
    N = int(eval(input()))
    As = list(map(int, input().split(" ")))
    print((solve(N, As)))

def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


assert gcd(10, 3) == 1


def solve(N, As):
    k = min(As)
    for a in As:
        k = gcd(k, a)
    return k


if __name__ == "__main__":
    N = int(eval(input()))
    As = list(map(int, input().split(" ")))
    print((solve(N, As)))

-from collections import Counter +def gcd(a, b): +    if b == 0: +        return a +    return gcd(b, a % b) -def factor(N): -    ret = [] -    i = 2 -    while N > 1: -        if N % i == 0: -            ret.append(i) -            N //= i -        else: -            i += 1 -    return ret +assert gcd(10, 3) == 1 -    iter = Counter(factor(min(As))) +    k = min(As) -        for k, v in list(iter.items()): -            if a % k != 0: -                iter[k] = 0 -            else: -                count = 0 -                kk = k -                while a % kk == 0: -                    kk *= k -                    count += 1 -                iter[k] = min(v, count) -    d = 1 -    for k, v in list(iter.items()): -        if v != 0: -            d *= k**v -    return d +        k = gcd(k, a) +    return k