#include <bits/stdc++.h>
using namespace std;
unsigned long long gcd(unsigned long long a, unsigned long long b) {
  return b == 0 ? a : gcd(b, a % b);
}
const int MAXN = 100000;
const int MAXDIFF = 200000;
const int MAXG = 100;
int n, forbidden;
int a[MAXN], b[MAXN], c[MAXN];
int pmn[MAXDIFF + 1];
int g[MAXDIFF + 1];
bitset<MAXDIFF + 1> moves;
bitset<MAXDIFF + 1> reachable[MAXG + 1];
bool solve() {
  moves.reset();
  for (int i = (0); i <= (MAXG); ++i) reachable[i].reset();
  memset(pmn, -1, sizeof(pmn));
  for (int i = (2); i <= (MAXDIFF); ++i)
    if (pmn[i] == -1)
      for (int j = i; j <= MAXDIFF; j += i)
        if (pmn[j] == -1) pmn[j] = i;
  for (int i = (2); i <= (MAXDIFF); ++i)
    if (i != forbidden && pmn[i] == i || pmn[i / pmn[i]] == i / pmn[i])
      moves.set(i);
  for (int i = (0); i <= (MAXDIFF); ++i) {
    g[i] = 0;
    while (g[i] <= MAXG && reachable[g[i]][i]) ++g[i];
    assert(g[i] <= MAXG);
    reachable[g[i]] |= moves << i;
  }
  int ret = 0;
  for (int i = (0); i < (n); ++i) {
    int x = b[i] - a[i] - 1, y = c[i] - b[i] - 1;
    ret ^= g[x] ^ g[y];
  }
  return ret != 0;
}
void run() {
  scanf("%d%d", &n, &forbidden);
  for (int i = (0); i < (n); ++i) scanf("%d%d%d", &a[i], &b[i], &c[i]);
  bool firstwin = solve();
  printf("%s\n%s\n", firstwin ? "Alice" : "Bob", firstwin ? "Bob" : "Alice");
}
int main() {
  run();
  return 0;
}
