n = int(eval(input()))

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

x = 1

if 0 in li:

    print((0))

else:

    for i in li:

        x = x * i

        if x > 10**18:

            print((-1))

            exit()

    print(x)

n = int(eval(input()))

list = input().split(" ")



if '0' in list:

    print((0))

    exit()



x = 1

for i in list:

    x = x * int(i)

    if x > 10**18:

        print((-1))

        exit()

print(x)

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

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

-li = list(map(int, input().split())) +list = input().split(" ") +if "0" in list: +    print((0)) +    exit() -if 0 in li: -    print((0)) -else: -    for i in li: -        x = x * i -        if x > 10**18: -            print((-1)) -            exit() -    print(x) +for i in list: +    x = x * int(i) +    if x > 10**18: +        print((-1)) +        exit() +print(x)