#include <bits/stdc++.h>
using namespace std;
const int N = 200003;
template <typename T>
inline void read(T &x) {
  int ch = getchar();
  x = 0;
  for (; ch < '0' || ch > '9'; ch = getchar())
    ;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
}
int n, x, pri[N], tot, sg[N], ans, a, b, c;
bitset<N> f[100], pre, notp;
inline void init(int m) {
  notp[0] = notp[1] = true;
  for (register int i = 2; i <= m; ++i) {
    if (!notp[i]) pri[tot++] = i;
    for (register int j = 0; j < tot && i * pri[j] <= m; ++j) {
      notp[i * pri[j]] = true;
      if (!(i % pri[j])) break;
    }
  }
}
int main() {
  read(n);
  read(x);
  init(N - 3);
  for (register int i = 0; i < tot; ++i) {
    pre[pri[i]] = 1;
    for (register int j = 0; j < tot && pri[i] * pri[j] <= N - 3; ++j)
      pre[pri[i] * pri[j]] = 1;
  }
  pre[x] = 0;
  f[0] = pre;
  for (register int i = 1; i <= N - 3; ++i) {
    while (f[sg[i]][i]) ++sg[i];
    f[sg[i]] |= (pre << i);
  }
  while (n--) {
    read(a);
    read(b);
    read(c);
    ans ^= sg[b - a - 1] ^ sg[c - b - 1];
  }
  puts(ans ? "Alice\nBob" : "Bob\nAlice");
}
