#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

signed main() {
    int n;
    cin >> n;
    int a = 1001, b = 1001, c = 1001;
    for (int i = 0; i < n; i++) {
        int x, y, z;
        cin >> x >> y >> z;
        vector<int> l = {x, y, z};
        sort(l.begin(), l.end());
        a = min(a, l[0]);
        b = min(b, l[1]);
        c = min(c, l[2]);
    }
    cout << a * b * c << '\n';
}