#include using namespace std; namespace { typedef double real; typedef long long ll; template ostream& operator<<(ostream& os, const vector& vs) { if (vs.empty()) return os << "[]"; auto i = vs.begin(); os << "[" << *i; for (++i; i != vs.end(); ++i) os << " " << *i; return os << "]"; } template istream& operator>>(istream& is, vector& vs) { for (auto it = vs.begin(); it != vs.end(); it++) is >> *it; return is; } int L, D; void input() { cin >> L >> D; } const int INF = 1<<28; void solve() { vector gr(L + 1, INF); gr[0] = 0; for (int x = 1; x <= L; x++) { vector pos(x, false); for (int a = 1; a <= x; a++) { for (int b = a + 1; a + b <= x; b++) { int c = x - a - b; if (not (a < b and b < c)) continue; if (c - a > D) continue; pos[ gr[a] ^ gr[b] ^ gr[c] ] = true; } } for (int i = 0; i <= x; i++) { if (not pos[i]) { gr[x] = i; break; } } } cout << (gr[L] ? "kado" : "matsu") << endl; } } int main() { input(); solve(); return 0; }