#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; const ll mod = 1000000007; const ll INF = (ll)1000000007 * 1000000007; typedef pair P; #define rep(i,n) for(int i=0;i=0;i--) #define Rep(i,sta,n) for(int i=sta;i=sta;i--) typedef long double ld; const ld eps = 1e-8; const ld pi = acos(-1.0); typedef pair LP; int dx[4]={1,-1,0,0}; int dy[4]={0,0,1,-1}; templatebool chmax(T &a, const T &b) {if(abool chmin(T &a, const T &b) {if(b S[64]; void solve(){ cin >> n; rep(i,n){ rep(j,6) cin >> v[i][j]; } rep(x,U){ rep(i,n){ ll res=1; rep(j,6){ if(x&(1<b;}); } ll ans=0; rep(x,U*U){ int x_=x; vector y(4,0); rep(j,6){ y[x_%4]+=(1<>=2; } ll res=1; rep(i,4){ res*=S[y[i]][0]; } chmax(ans,res); } cout << ans << endl; } int main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(50); solve(); }