#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
bool mark[1000005];
int prime[1000005], tot = 0;
bitset<200055> pr, last[105], full;
int f[1000005];
int main() {
  full.flip();
  full >>= 5550;
  int i, j, ykb, n, sum = 0, a, b, c;
  for (i = 2; i <= 200005; i++) {
    if (!mark[i]) {
      prime[tot++] = i;
    }
    for (j = 0; j <= j < 200005 && i * prime[j] < 200005; j++) {
      mark[i * prime[j]] = 1;
      if (!(i % prime[j])) {
        break;
      }
    }
  }
  for (i = 0; i < tot; i++) {
    pr.set(prime[i], 1);
  }
  cin >> n >> ykb;
  pr.set(ykb, 0);
  for (i = 0; i < tot; i++) {
    ykb = 200005 / prime[i];
    for (j = i; j < tot && prime[j] < ykb; j++) {
      pr.set(prime[i] * prime[j], 1);
    }
  }
  for (i = 1; i < 200005; i++) {
    for (j = 0; last[j][i] && j < 105; j++) {
    }
    f[i] = j;
    last[j] |= pr << i;
  }
  for (i = 0; i < n; i++) {
    scanf("%d %d %d", &a, &b, &c);
    sum ^= f[b - a] ^ f[c - b];
  }
  if (sum) {
    cout << "Alice" << endl << "Bob";
  } else {
    cout << "Bob" << endl << "Alice";
  }
  return 0;
}
