#include using namespace std; #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #define rep(i,n) for (int i=0;i<(long long)(n);i++) #define all(v) v.begin(),v.end() using ll=long long; using pll=pair; using tll=tuple; const ll INF=(1ll<<60); template void chmin(T &a,T b){ if(a>b){ a=b; } } template void chmax(T &a,T b){ if(a> n >> k; vector> s(n,vector(k)); rep(i,n){ rep(j,k){ cin >> s[i][j]; } } if(n<=1e4){ set ans; rep(i,n){ for(ll j=i+1;j v; rep(i,(1< p; rep(j,k){ if(i&(1< x(p.size()); ll save=0; rep(j,n){ if(j==0) continue; bool t=true; rep(l,p.size()){ if(s[j][p[l]]<=s[save][p[l]]){ t=false; break; } } if(t){ save=j; } } v.push_back(save); } set ans; for(auto &i:v){ rep(j,n){ if(i==j) continue; bool t=true; rep(l,k){ if(s[i][l]