#include using namespace std; typedef long long int64; int dp[501]; int L, D; int rec(int val) { if(val <= 5) return(false); if(~dp[val]) return(dp[val]); for(int i = 1; i <= val; i++) { for(int j = i + 1; i + j <= val; j++) { int k = val - i - j; if(k <= j) continue; if(k - i > D) continue; int proc = rec(i) + rec(j) + rec(k); if(proc == 0) return(true); } } return(dp[val] = false); } int main() { memset(dp, -1, sizeof(dp)); cin >> L >> D; if(rec(L)) cout << "kado" << endl; else cout << "matsu" << endl; }