#include #include #include #include using ll = long long int; int max3(int a, int b, int c){ return std::max(a, std::max(b, c)); } int min3(int a, int b, int c){ return std::min(a, std::min(b, c)); } bool diff3(int a, int b, int c){ return (a!=b && b!=c && c!=a); } bool isKadomatsu(int a, int b, int c){ return (diff3(a, b, c) && (b==max3(a, b, c) || b==min3(a, b, c))); } int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); int L, d; std::cin >> L >> d; std::vector dp(500, 0); for(int l=6; l<=L; ++l){ for(int i=1; i=tallest){ break; } if(tallest-i>d) continue; int tmp = dp[i]+dp[j]+dp[tallest]+1; if(tmp%2==0) continue; dp[l]=1; } } //std::cout << "dp[" << l << "] = " << dp[l] << "\n"; } std::cout << ((dp[L]==1) ? "kado\n" : "matsu\n"); return 0; }