#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long v = 0;
  char c = getchar();
  bool flag = false;
  while (c < '0' || c > '9') flag |= (c == '-'), c = getchar();
  while ('0' <= c && c <= '9')
    v = (v << 1) + (v << 3) + (c ^ 48), c = getchar();
  return flag ? -v : v;
}
long long const maxn = 2e5 + 5;
long long f;
long long sg[maxn];
long long q[maxn];
long long p[maxn], v[maxn], m;
bitset<maxn> F, b[100];
void calc(long long n) {
  for (long long i = 2; i <= n; i++) {
    if (!v[i]) p[++m] = i, v[i] = i;
    for (long long j = 1; j <= m && i * p[j] <= n && p[j] <= i; j++)
      v[i * p[j]] = p[j];
  }
  for (long long i = 1; i <= m; i++) {
    if (p[i] <= n && p[i] != f) F[p[i]] = true;
    for (long long j = i; j <= m && p[i] * p[j] <= n; j++)
      if (p[i] * p[j] != f) F[p[i] * p[j]] = true;
  }
  for (long long i = 0; i <= n; i++) {
    for (sg[i] = 0; b[sg[i]].test(i); sg[i]++)
      ;
    b[sg[i]] |= F << i;
  }
}
signed main() {
  long long n = rd();
  f = rd();
  long long mx = 0;
  for (long long a, b, c, i = 1; i <= n; i++)
    a = rd(), b = rd(), c = rd(), q[i * 2 - 1] = b - a - 1,
    q[i * 2] = c - b - 1, mx = max(mx, max(q[i * 2 - 1], q[i * 2]));
  n *= 2;
  calc(mx);
  long long ans = 0;
  for (long long i = 1; i <= n; i++) ans ^= sg[q[i]];
  puts(ans ? "Alice\nBob" : "Bob\nAlice");
  return 0;
}
