#include #define ll long long #define INF 1000000005 #define MOD 1000000007 #define EPS 1e-10 #define rep(i,n) for(int i=0;i<(int)n;++i) #define each(a, b) for(auto (a): (b)) #define all(v) (v).begin(),(v).end() #define fi first #define se second #define pb push_back #define show(x) cout <<#x<<" = "<<(x)<P; const int MAX_N = 502; int g[MAX_N]; int main() { cin.tie(0); ios::sync_with_stdio(false); int L,D; cin >> L >> D; rep(i,L+1){ g[i] = -1; } for(int i=0;i<=L;i++){ set st; for(int j=1;j j+D){ continue; } st.insert(g[j]^g[k]^g[rem]); } } int cnt = 0; while(1){ if(st.find(cnt) == st.end()){ break; } cnt++; } g[i] = cnt; } if(g[L]){ cout << "kado\n"; }else{ cout << "matsu\n"; } return 0; }