#include using namespace std; int main() { int L,D; cin >> L >> D; vector gr(L+1,0); for(int l = 0; l <= L; l++){ unordered_set memo; for(int l1 = 1; l1 < l; l1++) for(int l2 = l1 + 1; l - (l1 + l2) > l2 && l - (l1 + l2) - l1 <= D; l2++){ int l3 = l - (l1 + l2); memo.insert(gr[l1] ^ gr[l2] ^ gr[l3]); } int v = 0; while(memo.count(v))v++; gr[l] = v; } cout << ((gr[L])?"kado":"matsu") << endl; return 0; }