#include "bits/stdc++.h" #define MOD 1000000007 #define rep(i, n) for(ll i=0; i < (n); i++) #define rrep(i, n) for(ll i=(n)-1; i >=0; i--) #define ALL(v) v.begin(),v.end() #define rALL(v) v.rbegin(),v.rend() #define FOR(i, j, k) for(ll i=j;i llvec; typedef vector dvec; typedef pair P; typedef long double ld; struct edge{ll x, c;}; struct block{ ll a, b, c; P get(ll i){ if(i==0)return {min(b, c), max(b, c)}; else if(i==1)return {min(a, c), max(a, c)}; else return {min(a, b), max(a, b)}; } ll height(ll i){ if(i==0)return a; else if(i==1)return b; else return c; } }; /************************************** ** A main function starts from here ** ***************************************/ int main(){ ll N; cin >> N; vector v(N); rep(i, N){ cin >> v[i].a >> v[i].b >> v[i].c; } vector m(N*3); rep(k, N*3){ ll i = k/3; ll j = k%3; auto [a, b] = v[i].get(j); rep(l, N*3){ ll L = l/3; ll J = l%3; if(i==L)continue; auto [A, B] = v[L].get(J); if(A<=a and B<=b)m[k].push_back(l); } } vector dp(1<>ind)&1){ continue; }else{ dp[i | (1<