///////////////////////////////    _LeMur_
#define _CRT_SECURE_NO_WARNINGS
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <complex>
#include <cassert>
#include <cfloat>
#include <memory>
#include <chrono>
#include <random>
#include <climits>
#include <limits>
#include <bitset>
#include <cstdio>
#include <vector>
#include <string>
#include <stack>
#include <tuple>
#include <queue>
#include <ctime>
#include <cmath>
#include <list>
#include <map>
#include <set>

using namespace std;

const int N = 1000005;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;
// mt19937 myrand(chrono::steady_clock::now().time_since_epoch().count());
mt19937 myrand(373);

int T;
int n;
int a[N][3];

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  cin >> n;

  vector <int> mn(3);

  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < 3; j++) {
      cin >> a[i][j];
    }
    sort(a[i], a[i] + 3);
    
    for (int j = 0; j < 3; j++) {
      if (i == 1 || a[i][j] < mn[j]) {
        mn[j] = a[i][j];
      }
    }
  }

  cout << mn[0] * 1ll * mn[1] * mn[2] << endl;
  return 0;
}
