eval(input())

ls = list(map(int, input().split(' ')))

ls.sort(reverse=True)



def main(ls):

    if ls.count(0) > 0:

        print((0))

        return

    result = 1

    for i in ls:

        result *= i

        if result > 10 ** 18:

            print((-1))

            return



    print(result)



main(ls)
eval(input())

ls = list(map(int, input().split(' ')))



if ls.count(0) > 0:

    result = 0

else:

    result = 1

    for i in ls:

        result *= i

        if result > 10 ** 18:

            result = -1

            break

print(result)
eval(input())
ls = list(map(int, input().split(" ")))
ls.sort(reverse=True)


def main(ls):
    if ls.count(0) > 0:
        print((0))
        return
    result = 1
    for i in ls:
        result *= i
        if result > 10**18:
            print((-1))
            return
    print(result)


main(ls)

eval(input())
ls = list(map(int, input().split(" ")))
if ls.count(0) > 0:
    result = 0
else:
    result = 1
    for i in ls:
        result *= i
        if result > 10**18:
            result = -1
            break
print(result)

-ls.sort(reverse=True) - - -def main(ls): -    if ls.count(0) > 0: -        print((0)) -        return +if ls.count(0) > 0: +    result = 0 +else: -            print((-1)) -            return -    print(result) - - -main(ls) +            result = -1 +            break +print(result)