N = int(eval(input()))



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

if 0 in A:

    print((0))

else:

    p = 1

    for a in A:

        p *= a

        if p > 10**18:

            p = -1

            break



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

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



if 0 in A:

    print((0))

else:

    r = 1

    for a in A:

        r *= a

        if r > 10**18:

            r = -1

            break

    print(r)
N = int(eval(input()))
A = tuple(map(int, input().split()))
if 0 in A:
    print((0))
else:
    p = 1
    for a in A:
        p *= a
        if p > 10**18:
            p = -1
            break
    print(p)

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

-A = tuple(map(int, input().split())) +A = list(map(int, input().split())) -    p = 1 +    r = 1 -        p *= a -        if p > 10**18: -            p = -1 +        r *= a +        if r > 10**18: +            r = -1 -    print(p) +    print(r)