n = int(eval(input()))

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

a.sort()

ans = 1



for i in range(n):

    ans *= a[i]

    if(ans > 1000000000000000000):

        break

    

if(ans > 1000000000000000000):

    print((-1))

    

else:

    print(ans)

n = int(eval(input()))

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



if 0 in a:

    print((0))

    exit()



ans = 1

for i in a:

    ans *= i

    if(ans > 10**18):

        print((-1))

        exit()



print(ans)
n = int(eval(input()))
a = list(map(int, input().split()))
a.sort()
ans = 1
for i in range(n):
    ans *= a[i]
    if ans > 1000000000000000000:
        break
if ans > 1000000000000000000:
    print((-1))
else:
    print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
if 0 in a:
    print((0))
    exit()
ans = 1
for i in a:
    ans *= i
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

-a.sort() +if 0 in a: +    print((0)) +    exit() -for i in range(n): -    ans *= a[i] -    if ans > 1000000000000000000: -        break -if ans > 1000000000000000000: -    print((-1)) -else: -    print(ans) +for i in a: +    ans *= i +    if ans > 10**18: +        print((-1)) +        exit() +print(ans)