#include using namespace std; #define LL long long #define lowbit(x) ((x) & -(x)) #define lson l,mid,id<<1 #define rson mid+1,r,id<<1|1 #define MID(l, r) (((l)+(r))>>1) const int maxn = (int) 5e2 + 20; const int MOD = 1e9 + 7; //const int MOD = 998244353; const double eps = 1e-8; inline int sig(double x) {return x < -eps ? -1 : x > eps;} template < typename T > inline void read(T &x) { static bool f; static char ch; f = 0; x = 0; ch = getchar(); while(ch < '0' || '9' < ch) {if(ch == '-') f = 1; ch = getchar();} while('0' <= ch && ch <= '9') {x = (x << 3) + (x << 1) + (ch - '0'); ch = getchar();} if(f) x = -x; } LL gcd(LL a, LL b) {if(!b) return a; return gcd(b, a % b);} LL fp(LL a, LL n, LL m = MOD) {LL res; for(res = 1; n; a = a * a % m, n >>= 1) if(n & 1) res = res * a % m; return res;} int n, m; int vis[55][55]; int us[55]; int match[55]; int ans[55]; // //int dfs(int i) //{ // if(i == m) // { // return 1; // } // // for(int j = 0; j < m; j++) // { // if(vis[i][j] && us[j] == 0) // { // us[j] = 1; // ans[i] = j; // int t = dfs(i + 1); // if(t) // { // return 1; // } // us[j] = 0; // } // } // return 0; //} int find(int x) { for(int j = 0; j < m; j++) { if(vis[x][j] && !us[j]) { us[j] = 1; if(match[j] == -1 || find(match[j])) { match[j] = x; return 1; } } } return 0; } void work() { cin >>n >>m; for(int i = 0; i < m; i++) for(int j = 0; j < m; j++) vis[i][j] = 1; while(n--) { string a, b; cin >>a >>b; for(int i = 0; i < m; i++) { for(int j = 0; j < m; j++) { if(a[i] != b[j]) vis[i][j] = 0; } } } // for(int i = 0; i < m; i++) // { // for(int j = 0; j < m; j++) // cout <>tc; for(int ca = 1; ca <= tc; ca++) { // printf("Case #%d: ", ca); work(); } return 0; }