N = int(eval(input()))

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

ans = 1

if 0 in A:

    print((0))

else:

    for i in range(N):

        a = A[i]

        for j in range(19):

            if a <= 10**j:

                m = j

                break

        for k in range(19):

            if ans <= 10**k:

                n = k

                break

        if(m+n > 19):

            print((-1))

            break

        elif(ans*a == 10**18):

            ans = ans*a

        elif(ans*a > 10**18):

            print((-1))

            break

        else:

            ans = ans*a

        if i == N-1:

            print(ans)
N = int(eval(input()))

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

ans = 1

if 0 in A:

    print((0))

else:

    for i in range(N):

        ans = ans*A[i]

        if(ans > 10**18):

            print((-1))

            break

        elif(i == N-1):

            print(ans)
N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
if 0 in A:
    print((0))
else:
    for i in range(N):
        a = A[i]
        for j in range(19):
            if a <= 10**j:
                m = j
                break
        for k in range(19):
            if ans <= 10**k:
                n = k
                break
        if m + n > 19:
            print((-1))
            break
        elif ans * a == 10**18:
            ans = ans * a
        elif ans * a > 10**18:
            print((-1))
            break
        else:
            ans = ans * a
        if i == N - 1:
            print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
ans = 1
if 0 in A:
    print((0))
else:
    for i in range(N):
        ans = ans * A[i]
        if ans > 10**18:
            print((-1))
            break
        elif i == N - 1:
            print(ans)

-        a = A[i] -        for j in range(19): -            if a <= 10**j: -                m = j -                break -        for k in range(19): -            if ans <= 10**k: -                n = k -                break -        if m + n > 19: +        ans = ans * A[i] +        if ans > 10**18: -        elif ans * a == 10**18: -            ans = ans * a -        elif ans * a > 10**18: -            print((-1)) -            break -        else: -            ans = ans * a -        if i == N - 1: +        elif i == N - 1: