#include #include #include using namespace std; vector memo; int d; int grundy(int L){ if(memo[L] != -1) return memo[L]; int ret; set s; for(int a=1; a> L >> d; memo.resize(L+1, -1); int ans = grundy(L); cout << (ans!=0?"kado":"matsu") << endl; return 0; }