#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const int maxn = 200020;
const long long mod = 1e9 + 7;
namespace Prime {
const int N = 2e5;
int prime[N + 20], tag[N + 20], mn[N + 20], Cnt;
void init() {
  for (register int i = 2; i <= N; i++) {
    if (!tag[i]) prime[++Cnt] = i;
    for (register int j = 1; j <= Cnt; j++) {
      if (prime[j] * i > N) break;
      tag[i * prime[j]] = 1;
      mn[i * prime[j]] = prime[j];
      if (i % prime[j] == 0) break;
    }
  }
}
}  // namespace Prime
using namespace Prime;
bitset<maxn> val;
bitset<maxn> bit[120];
int n, F;
int sg[maxn];
vector<int> vec;
void solve() {
  for (register int i = 1; i <= Cnt; i++) {
    vec.push_back(prime[i]);
    for (register int j = 1; j <= i; j++) {
      if (prime[i] * prime[j] > N) break;
      vec.push_back(prime[i] * prime[j]);
    }
  }
  sort(vec.begin(), vec.end());
  vec.erase(unique(vec.begin(), vec.end()), vec.end());
  for (register int i = 0; i < (int)vec.size(); i++) val[vec[i]] = 1;
  val[F] = 0;
  memset(sg, -1, sizeof(sg));
  sg[0] = 0;
  bit[0] = val;
  int k = 100;
  for (register int i = 1; i <= N; i++) {
    for (register int j = 0; j <= k; j++) {
      if (!bit[j][i]) {
        sg[i] = j;
        break;
      }
    }
    bit[sg[i]] |= val << i;
  }
}
int main() {
  scanf("%d %d", &n, &F);
  init();
  solve();
  int ans = 0;
  for (register int i = 1; i <= n; i++) {
    int r, w, b;
    scanf("%d %d %d", &b, &w, &r);
    ans ^= sg[w - b] ^ sg[r - w];
  }
  if (ans)
    puts("Alice\nBob");
  else
    puts("Bob\nAlice");
}
