K=int(eval(input()))

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



mx=2

mn=2

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

    a = A[i]

    a_mn = ((mn+a-1)//a)*a

    a_mx = mx - mx%a

    if a_mn > a_mx:

        print((-1))

        exit()

    mn=a_mn

    mx=a_mx+a-1

print(("{} {}".format(mn,mx)))
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)

import sys

def main(N, A):

    mx = 2

    mn = 2

    for a in reversed(A):

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

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

        if mn > mx:

            print((-1))

            return

    print((mn, mx))



if __name__ == '__main__':

    input = sys.stdin.readline

    N = int(eval(input()))

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

    main(N, A)

K = int(eval(input()))
A = list(map(int, input().split()))
mx = 2
mn = 2
for i in range(K - 1, -1, -1):
    a = A[i]
    a_mn = ((mn + a - 1) // a) * a
    a_mx = mx - mx % a
    if a_mn > a_mx:
        print((-1))
        exit()
    mn = a_mn
    mx = a_mx + a - 1
print(("{} {}".format(mn, mx)))

# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
import sys


def main(N, A):
    mx = 2
    mn = 2
    for a in reversed(A):
        mx = (mx // a + 1) * a - 1
        mn = (mn + a - 1) // a * a
        if mn > mx:
            print((-1))
            return
    print((mn, mx))


if __name__ == "__main__":
    input = sys.stdin.readline
    N = int(eval(input()))
    (*A,) = list(map(int, input().split()))
    main(N, A)

-K = int(eval(input())) -A = list(map(int, input().split())) -mx = 2 -mn = 2 -for i in range(K - 1, -1, -1): -    a = A[i] -    a_mn = ((mn + a - 1) // a) * a -    a_mx = mx - mx % a -    if a_mn > a_mx: -        print((-1)) -        exit() -    mn = a_mn -    mx = a_mx + a - 1 -print(("{} {}".format(mn, mx))) +# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..) +import sys + + +def main(N, A): +    mx = 2 +    mn = 2 +    for a in reversed(A): +        mx = (mx // a + 1) * a - 1 +        mn = (mn + a - 1) // a * a +        if mn > mx: +            print((-1)) +            return +    print((mn, mx)) + + +if __name__ == "__main__": +    input = sys.stdin.readline +    N = int(eval(input())) +    (*A,) = list(map(int, input().split())) +    main(N, A)