n = int(input()) A = [1] + sorted(list(map(int,input().split()))) ans = A[-1] for i in range(n): if i%2 == 0: ans *= A[-2-i] else: ans //= A[-2-i] print(ans)