K = int(eval(input()))

A = list(map(int,input().split()))

B = [2,2]

for i in range(K-1,-1,-1):

    a = A[i]

    bmin = B[0]

    bmax = B[1]

    if bmin%a==0:

        bmin = bmin

    else:

        bmin = (bmin//a+1)*a

    if bmin>bmax:

        B = []

        break

    else:

        if bmax%a==0:

            bmax = bmax+a-1

        else:

            bmax = (bmax//a)*a+a-1

        B = [bmin,bmax]

if len(B)==0:

    print((-1))

else:

    print((B[0],B[1]))
import math

K = int(eval(input()))

A = list(map(int,input().split()))

if A[K-1]!=2:

    print((-1))

elif K==1:

    print((2,3))

else:

    nmin = 2

    nmax = 2+A[K-1]-1

    flag = 0

    for i in range(K-2,-1,-1):

        b = A[i]

        nmin = math.ceil(nmin/b)*b

        nmax = math.floor(nmax/b)*b

        if nmin>nmax:

            flag = 1

            break

        nmax += b-1

    if flag==1:

        print((-1))

    else:

        print((nmin,nmax))
K = int(eval(input()))
A = list(map(int, input().split()))
B = [2, 2]
for i in range(K - 1, -1, -1):
    a = A[i]
    bmin = B[0]
    bmax = B[1]
    if bmin % a == 0:
        bmin = bmin
    else:
        bmin = (bmin // a + 1) * a
    if bmin > bmax:
        B = []
        break
    else:
        if bmax % a == 0:
            bmax = bmax + a - 1
        else:
            bmax = (bmax // a) * a + a - 1
        B = [bmin, bmax]
if len(B) == 0:
    print((-1))
else:
    print((B[0], B[1]))

import math

K = int(eval(input()))
A = list(map(int, input().split()))
if A[K - 1] != 2:
    print((-1))
elif K == 1:
    print((2, 3))
else:
    nmin = 2
    nmax = 2 + A[K - 1] - 1
    flag = 0
    for i in range(K - 2, -1, -1):
        b = A[i]
        nmin = math.ceil(nmin / b) * b
        nmax = math.floor(nmax / b) * b
        if nmin > nmax:
            flag = 1
            break
        nmax += b - 1
    if flag == 1:
        print((-1))
    else:
        print((nmin, nmax))

+import math + -B = [2, 2] -for i in range(K - 1, -1, -1): -    a = A[i] -    bmin = B[0] -    bmax = B[1] -    if bmin % a == 0: -        bmin = bmin +if A[K - 1] != 2: +    print((-1)) +elif K == 1: +    print((2, 3)) +else: +    nmin = 2 +    nmax = 2 + A[K - 1] - 1 +    flag = 0 +    for i in range(K - 2, -1, -1): +        b = A[i] +        nmin = math.ceil(nmin / b) * b +        nmax = math.floor(nmax / b) * b +        if nmin > nmax: +            flag = 1 +            break +        nmax += b - 1 +    if flag == 1: +        print((-1)) -        bmin = (bmin // a + 1) * a -    if bmin > bmax: -        B = [] -        break -    else: -        if bmax % a == 0: -            bmax = bmax + a - 1 -        else: -            bmax = (bmax // a) * a + a - 1 -        B = [bmin, bmax] -if len(B) == 0: -    print((-1)) -else: -    print((B[0], B[1])) +        print((nmin, nmax))