import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int L = scanner.nextInt(); int D = scanner.nextInt(); System.out.println(new Solver().solve(L, D)); } } class Solver { public String solve(int l, int d) { if (win(l, d)) { return "kado"; } return "matsu"; } private boolean win(int l, final int d) { for (int i = 1; i < l - 2; i++) { for (int j = i + 1; j < l - 1; j++) { int k = l - i - j; if (i <= 0 || j <= 0 || k <= 0) continue; if (i == j || i == k || j == k) continue; if (Math.max(i, Math.max(j, k)) - Math.min(i, Math.min(j, k)) > d) continue; if (!win(i, d) && !win(j, d) && !win(k, d)) return true; } } return false; } }