/**
 *    author:  tourist
 *    created: 04.11.2025 19:59:27
**/
#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n), b(n), c(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> b[i] >> c[i];
    if (a[i] > b[i]) swap(a[i], b[i]);
    if (a[i] > c[i]) swap(a[i], c[i]);
    if (b[i] > c[i]) swap(b[i], c[i]);
  }
  cout << *min_element(a.begin(), a.end()) * *min_element(b.begin(), b.end()) * *min_element(c.begin(), c.end()) << '\n';
  return 0;
}
