#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T max(T &a, T &b) {
  return a > b ? a : b;
}
template <class T>
inline T min(T &a, T &b) {
  return a < b ? a : b;
}
template <class T>
inline void gt(T &x) {
  x = 0;
  T f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  x *= f;
}
template <class T>
inline void pt(T x) {
  if (x < 0) x = -x, putchar('-');
  static int cnt;
  cnt = 0;
  static char a[50];
  do {
    a[++cnt] = x % 10 + '0';
    x /= 10;
  } while (x);
  for (register int i = cnt; i >= 1; --i) putchar(a[i]);
}
template <class T>
inline void wr(T x) {
  pt(x);
  putchar('\n');
}
template <class T>
inline void wr2(T x) {
  pt(x);
  putchar(' ');
}
const int N = 2e5 + 100, maxn = 200001;
bitset<N> b[105], P;
int v[N], prime[N], sg[N], cnt;
inline void pre(int n, int f) {
  v[1] = 1;
  b[0].reset();
  for (register int i = 2; i <= maxn; ++i) {
    if (!v[i]) {
      prime[++cnt] = i;
      b[0].set(i - 1);
    }
    for (register int j = 1; j <= cnt && prime[j] * i <= maxn; ++j) {
      int x = i * prime[j];
      v[x] = 1;
      if (!v[i]) b[0].set(x - 1);
      if (i % prime[j] == 0) break;
    }
  }
  b[0].reset(f);
  P = b[0];
  for (register int i = 1; i <= maxn; ++i) {
    sg[i] = 0;
    while (b[sg[i]].test(i - 1)) ++sg[i];
    b[sg[i]] |= P << i;
  }
}
int main() {
  int n, f, x, y, z, ans = 0;
  gt(n);
  gt(f);
  pre(n, f);
  for (register int i = 1; i <= n; ++i) {
    gt(x);
    gt(y);
    gt(z);
    ans ^= sg[y - x - 1];
    ans ^= sg[z - y - 1];
  }
  puts(ans ? "Alice" : "Bob");
  puts(ans ? "Bob" : "Alice");
  fclose(stdin);
  fclose(stdout);
  return 0;
}
