#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; } map, int> cache; bool dfs(int x, int w) { auto key = make_pair(x, w); if (cache.count(key)) return cache[key]; for (int a = 1; a <= x; a++) { for (int b = a; a + b <= x; b++) { int c = x - a - b; if (c < b) continue; if (c - a > D) continue; if (a == b || b == c || c == a) continue; //cout << "abc: " << a << " " << b << " " << c << endl; if ((dfs(a, !w) ^ dfs(b, !w) ^ dfs(c, !w)) == 0) return cache[key] = true; } } return cache[key] = false; } void solve() { cout << (dfs(L, 0) ? "kado" : "matsu") << endl; } } int main() { input(); solve(); return 0; }