n = int(eval(input()))

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

b = sorted(a)

ans = 1

for val in b:

  ans *= val

  if ans > 10**18:

    print((-1))

    exit()

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

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

ans = 1

a.sort()

if a[0] == 0:

    print((0))

    exit()

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()))
b = sorted(a)
ans = 1
for val in b:
    ans *= val
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
ans = 1
a.sort()
if a[0] == 0:
    print((0))
    exit()
for i in a:
    ans *= i
    if ans > 10**18:
        print((-1))
        exit()
print(ans)

-b = sorted(a) -for val in b: -    ans *= val +a.sort() +if a[0] == 0: +    print((0)) +    exit() +for i in a: +    ans *= i