n = int(eval(input()))

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

a.sort(reverse=True)



ans = 1

if 0 in a:

    ans = 0

    print(ans)

    exit()

else:

    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()))



ans = 1

if 0 in a:

    ans = 0

    print(ans)

    exit()

else:

    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(reverse=True)
ans = 1
if 0 in a:
    ans = 0
    print(ans)
    exit()
else:
    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()))
ans = 1
if 0 in a:
    ans = 0
    print(ans)
    exit()
else:
    for i in a:
        ans *= i
        if ans > 10**18:
            print((-1))
            exit()
print(ans)

-a.sort(reverse=True)