n = int(eval(input()))

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



ans = 1

for a in A:

    ans *= a

    if 10**18 < ans:

        print((-1))

        break

else:

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

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

if 0 in A:

    print((0))

else:

    ans = 1

    for a in A:

        ans *= a

        if 10**18 < ans:

            print((-1))

            break

    else:

        print(ans)
n = int(eval(input()))
A = sorted(map(int, input().split()))
ans = 1
for a in A:
    ans *= a
    if 10**18 < ans:
        print((-1))
        break
else:
    print(ans)

n = int(eval(input()))
A = list(map(int, input().split()))
if 0 in A:
    print((0))
else:
    ans = 1
    for a in A:
        ans *= a
        if 10**18 < ans:
            print((-1))
            break
    else:
        print(ans)

-A = sorted(map(int, input().split())) -ans = 1 -for a in A: -    ans *= a -    if 10**18 < ans: -        print((-1)) -        break +A = list(map(int, input().split())) +if 0 in A: +    print((0)) -    print(ans) +    ans = 1 +    for a in A: +        ans *= a +        if 10**18 < ans: +            print((-1)) +            break +    else: +        print(ans)