pr = 1
lst = [float(input()) for i in range(int(input("n=")))]
for i in range(len(lst)):
if lst[i] != 0:
pr *= lst[i]
print(pr)
pr = 1
lst = [float(input()) for i in range(int(input("n=")))]
for i in range(len(lst)):
if lst[i] != 0:
pr *= lst[i]
print(pr)