#include <bits/stdc++.h>
using namespace std;
inline char gc() {
  static char buf[1000010], *p1 = buf, *p2 = buf;
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
template <typename T>
inline void read(T& x) {
  char ch = getchar();
  T a = 0, b = 1;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') ch = getchar(), b = -1;
  while (ch >= '0' && ch <= '9')
    a = (a << 3) + (a << 1) + ch - '0', ch = getchar();
  x = a * b;
}
template <typename T>
inline void write(T x, char ch = '\0') {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) write(x / 10);
  putchar(x % 10 + '0');
  if (ch != '\0') putchar(ch);
}
template <typename T>
inline void Swap(T& x, T& y) {
  x = x ^ y;
  y = x ^ y;
  x = x ^ y;
}
template <typename T>
inline void chkmin(T& x, T y) {
  x = (y < x ? y : x);
}
template <typename T>
inline void chkmax(T& x, T y) {
  x = (y > x ? y : x);
}
template <typename T>
inline T mini(T x, T y) {
  return x < y ? x : y;
}
template <typename T>
inline T maxi(T x, T y) {
  return x > y ? x : y;
}
const int maxn = 2e5;
int n, f, tot, prime[maxn + 10], not_prime[maxn + 10], sg[maxn + 10];
bitset<maxn + 10> tr[110], pd;
void init() {
  not_prime[1] = 1;
  for (int i = 2; i <= maxn; ++i) {
    if (!not_prime[i]) prime[++tot] = i;
    for (int j = 1; j <= tot && 1ll * i * prime[j] <= maxn; ++j) {
      not_prime[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
}
int main() {
  read(n);
  read(f);
  init();
  for (int i = 1; i <= tot; ++i) {
    int x = prime[i];
    if (1ll * x * x <= maxn) pd[x * x] = 1;
    pd[x] = 1;
  }
  pd[f] = 0;
  tr[0] = pd;
  for (int i = 1; i <= maxn; ++i) {
    while (tr[sg[i]][i]) ++sg[i];
    tr[sg[i]] |= (pd << i);
  }
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    int a, b, c;
    read(a);
    read(b);
    read(c);
    ans ^= sg[b - a + 1];
    ans ^= sg[c - b + 1];
  }
  if (ans)
    printf("Alice\nBob\n");
  else
    printf("Bob\nAlice\n");
  return 0;
}
