def multiply(num_list):

  # if "0" in list, return 0

  if 0 in set(num_list):

    return 0

  

  # if res > 10^18: return -1

  MAX = pow(10,18)

  res = 1

  for i in num_list:

    res *= i

    if res == 0:

      return 0

    if res > MAX:

      return -1

  return res



eval(input())

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

print((multiply(num_list)))
def multiply(num_list):

  # if "0" in list, return 0

  if 0 in num_list:

    return 0

  

  # if res > 10^18: return -1

  MAX = pow(10,18)

  res = 1

  for i in num_list:

    res *= i

    if res > MAX:

      return -1

  return res



eval(input())

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

print((multiply(num_list)))
def multiply(num_list):
    # if "0" in list, return 0
    if 0 in set(num_list):
        return 0
    # if res > 10^18: return -1
    MAX = pow(10, 18)
    res = 1
    for i in num_list:
        res *= i
        if res == 0:
            return 0
        if res > MAX:
            return -1
    return res


eval(input())
num_list = list(map(int, input().split()))
print((multiply(num_list)))

def multiply(num_list):
    # if "0" in list, return 0
    if 0 in num_list:
        return 0
    # if res > 10^18: return -1
    MAX = pow(10, 18)
    res = 1
    for i in num_list:
        res *= i
        if res > MAX:
            return -1
    return res


eval(input())
num_list = list(map(int, input().split()))
print((multiply(num_list)))

-    if 0 in set(num_list): +    if 0 in num_list: -        if res == 0: -            return 0