#include #define rep(a,n) for (ll a = 0; a < (n); ++a) using namespace std; using ll = long long; typedef pair P; typedef pair PP; typedef vector > Graph; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } const ll INF = 1e18; //入力 ll l,d; vectorg; ll grundy(ll l){ if(g[l]>=0)return g[l]; setst; for(int i=1;i> l >> d; g.resize(l+1,-1); if(grundy(l)==0){ cout << "matsu" << endl; } else{ cout << "kado" << endl; } return 0; }