#include int main(){ using namespace std; unsigned long N; cin >> N; if(N & 1){ if(N == 1){ unsigned long A; cin >> A; cout << A << endl; }else puts("1"); return 0; } vector A(N); for(auto&& i : A)cin >> i; nth_element(begin(A), end(A) - 2, end(A), greater<>{}); const auto a{A.back()}; A.pop_back(); A.back() *= a; cout << *min_element(begin(A), end(A)) << endl; return 0; }