#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T read(register T& t) {
  register T f = 1;
  register char ch = getchar();
  t = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') t = t * 10 + ch - '0', ch = getchar();
  t *= f;
  return t;
}
template <typename T, typename... Args>
inline void read(T& t, Args&... args) {
  read(t);
  read(args...);
}
const long long p = 998244353;
inline long long power(register long long x, register long long k = p - 2) {
  register long long re = 1;
  for (; k; k >>= 1, x = x * x % p)
    if (k & 1) re = re * x % p;
  return re;
}
int prime[200005], prime_top;
bool vis[200005];
int n, f;
bitset<200005> trs;
int sg[200005];
bitset<200005> us[105];
int main() {
  for (int i = 2; i <= 200000; i++) {
    if (vis[i] == 0) prime[++prime_top] = i;
    for (int j = 1; j <= prime_top && 1ll * i * prime[j] <= 200000; j++) {
      vis[i * prime[j]] = 1;
      if (i % prime[j] == 0) break;
    }
  }
  read(n, f);
  for (int i = 1; i <= prime_top; i++) trs[prime[i]] = 1;
  for (int i = 1; i <= prime_top; i++)
    for (int j = i; j <= prime_top; j++)
      if (1ll * prime[i] * prime[j] <= 200000) trs[prime[i] * prime[j]] = 1;
  trs[f] = 0;
  us[0] = trs;
  for (int i = 1; i <= n; i++) {
    while (us[sg[i]][i]) sg[i]++;
    us[sg[i]] |= trs << i;
  }
  int ans = 0;
  while (n--) {
    int a, b, c;
    read(a, b, c);
    int A = b - a - 1, B = c - b - 1;
    ans ^= sg[A] ^ sg[B];
  }
  if (ans)
    printf("Bob\nAlice\n");
  else
    printf("Alice\nBob\n");
  return 0;
}
