#include <bits/stdc++.h>
using namespace std;
int gi() {
  int x = 0, w = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') w = 0, ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return w ? x : -x;
}
const int N = 1e5 + 5;
int n, f, zhi[N], pri[N], tot, cnt[N], sg[N], ans;
bitset<N> P, G[105];
int main() {
  n = gi();
  f = gi();
  cnt[1] = 20020415;
  for (int i = 2; i < N; ++i) {
    if (!zhi[i]) pri[++tot] = i, cnt[i] = 1;
    for (int j = 1; i * pri[j] < N; ++j) {
      zhi[i * pri[j]] = 1;
      cnt[i * pri[j]] = cnt[i] + 1;
      if (i % pri[j] == 0) break;
    }
  }
  cnt[f] = 20020415;
  for (int i = 1; i < N; ++i) P[i] = (cnt[i] <= 2);
  for (int i = 0; i < N; ++i) {
    while (G[sg[i]][i]) ++sg[i];
    G[sg[i]] |= P << i;
  }
  for (int i = 1, x, y, z; i <= n; ++i)
    x = gi(), y = gi(), z = gi(), ans ^= sg[y - x - 1] ^ sg[z - y - 1];
  puts(ans ? "Alice" : "Bob");
  puts(ans ? "Bob" : "Alice");
  return 0;
}
