#!/usr/bin/env python3 # from typing import * import sys import io import math import collections import decimal import itertools import bisect import heapq def input(): return sys.stdin.readline()[:-1] # sys.setrecursionlimit(1000000) # _INPUT = """# paste here... # """ # sys.stdin = io.StringIO(_INPUT) def get_grundy(L): if L < 6: return 0 if L in Memo: return Memo[L] s = set() for a in range(1, L//3-1 + 1): for b in range(a+1, (L-a-1)//2 + 1): c = L - a - b if c - a <= D: s.add(get_grundy(a) ^ get_grundy(b) ^ get_grundy(c)) mex = 0 while mex in s: mex += 1 Memo[L] = mex return mex Memo = collections.defaultdict(int) L, D = map(int, input().split()) g = get_grundy(L) if g == 0: print('matsu') else: print('kado')