#include #include using namespace std; int g[510]; int main() { int L, D; cin >> L >> D; for (int x = 6; x <= L; x++) { set S; for (int L1 = 1; L1 * 3 <= L; L1++) { for (int L2 = L1 + 1; L - (L1 + L2) > L2; L2++) { int L3 = L - (L1 + L2); if (L3 - L1 > D) continue; S.insert(g[L1] ^ g[L2] ^ g[L3]); } } int num = 0; for (int n : S) { if (num != n) break; num++; } g[x] = num; } if (g[L]) cout << "kado" << endl; else cout << "matsu" << endl; return 0; }