#include <bits/stdc++.h>

using namespace std;
using ll = long long;
// #define int long long
using ld = long double;

#define all(v) (v).begin(), (v).end()
#define db(x) cerr << #x << " = " << x << '\n'
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define sz(v) (int)((v).size())
#define pw(x) (1LL << (int)(x))
#define fr(i, a, b) for (int i = (a); i <= (b); ++i)
#define rf(i, a, b) for (int i = (a); i >= (b); --i)
#define fe(x, y) for (auto &x: y)
#define fi first
#define se second

mt19937_64 rng(566);

ll rnd(ll l, ll r) {
    return rng() % (r - l + 1) + l;
}

template<typename T>
bool umn(T &a, T b) {
    return a > b ? a = b, 1 : 0;
}

template<typename T>
bool umx(T &a, T b) {
    return a < b ? a = b, 1 : 0;
}

template<typename T>
using ve = vector<T>;

using pii = pair<int, int>;
using pll = pair<ll, ll>;

const double eps = 1e-8;
const ll mod = 1e9 + 8;
const int inf0 = 1e9 + 10;
const ll inf = 2e18 + 10;

void solve();

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifdef LC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

void solve() {
    int n;
    cin >> n;
    vector<vector<int>> boxes(n, vector<int>(3));
    vector<int> mins(3, 1001);
    for (int i = 0; i < n; ++i) {
        cin >> boxes[i][0] >> boxes[i][1] >> boxes[i][2];
        sort(all(boxes[i]));
        reverse(all(boxes[i]));
        for (int j = 0; j < 3; ++j) {
            mins[j] = min(mins[j], boxes[i][j]);
        }
    }
    cout << (ll)(mins[0]) * mins[1] * mins[2] << '\n';
}