#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, x, pr[N], sg[N], ans, cnt;
bool ip[N];
bitset<N> f[110], ok;
void sieve(int n) {
  memset(ip, 1, sizeof(ip));
  ip[1] = 0;
  for (int i = (2); i <= (n); ++i) {
    if (ip[i]) pr[++cnt] = i, ok[i] = 1;
    for (int j = 1; j <= cnt && i * pr[j] <= n; ++j) {
      ip[i * pr[j]] = 0;
      if (i % pr[j] == 0) break;
    }
  }
}
void pre(int n) {
  for (int i = (1); i <= (cnt); ++i)
    for (int j = 1; pr[i] * pr[j] <= n; ++j) ok[pr[i] * pr[j]] = 1;
  ok[x] = 0;
  f[0] = ok;
  for (int i = (1); i <= (n); ++i) {
    while (f[sg[i]][i]) ++sg[i];
    f[sg[i]] |= ok << i;
  }
}
int main() {
  scanf("%d%d", &n, &x);
  sieve(1e5);
  pre(1e5);
  for (int i = (1); i <= (n); ++i) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    ans ^= sg[b - a - 1] ^ sg[c - b - 1];
  }
  puts(ans ? "Alice" : "Bob");
  puts(ans ? "Bob" : "Alice");
  return 0;
}
