#include #include #include using namespace atcoder; using mint = modint; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 2000000000000000005 int check(string &a,string &b){ bool f0 = true,f1 = true; rep(i,a.size()){ if(a[i]b[i])f1 = false; } if(f0)return 1; if(f1)return -1; return 0; } int main(){ int N,K; cin>>N>>K; vector ans; rep(i,N){ string t; cin>>t; //rep(j,K)scanf("%d",&t[j]); bool f = true; rep(j,ans.size()){ if(ans[j]==t)f = false; } if(!f)continue; { vector na; rep(j,ans.size()){ if(check(t,ans[j])==1)continue; na.push_back(ans[j]); if(check(t,ans[j])==-1)f = false; } if(f)na.push_back(t); swap(ans,na); } } cout<