#include <bits/stdc++.h>
using namespace std;
void getint(int &v) {
  char ch, fu = 0;
  for (ch = '*'; (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') fu = 1, ch = getchar();
  for (v = 0; ch >= '0' && ch <= '9'; ch = getchar()) v = v * 10 + ch - '0';
  if (fu) v = -v;
}
bool u[500010];
int n, f, x, y, z, mex, mx, ans, sg[500010], cnt[500010];
bitset<200010> b, c[111];
int main() {
  cin >> n >> f;
  for (int i = 1; i <= n; ++i) {
    getint(x), getint(y), getint(z);
    ++cnt[y - x - 1];
    ++cnt[z - y - 1];
  }
  for (int i = 1; i <= 200000; ++i) cnt[i] %= 2;
  for (int i = 1; i <= 200000; ++i)
    if (cnt[i]) mx = max(mx, i);
  for (int i = 2; i <= 200000; ++i)
    if (!u[i]) {
      for (int j = 2; j <= 200000 / i; ++j) u[i * j] = 1;
    }
  for (int i = 2; i <= 200000; ++i)
    if (!u[i]) b[i] = 1;
  for (int i = 2; i <= 200000; ++i)
    for (int j = i; j <= 200000 / i; ++j)
      if (!u[i] && !u[j]) b[i * j] = 1;
  b[f] = 0;
  sg[0] = 0;
  c[0] = b;
  for (int i = 1; i <= mx; ++i) {
    mex = 0;
    for (int j = 0; j <= 100; ++j)
      if (c[j][i])
        ++mex;
      else
        break;
    sg[i] = mex;
    c[mex] |= (b << i);
  }
  for (int i = 1; i <= 200000; ++i)
    if (cnt[i]) ans ^= sg[i];
  if (ans)
    printf("Alice\nBob\n");
  else
    printf("Bob\nAlice\n");
  return 0;
}
