#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
int n, w, v[N << 1], su[N << 1], tot = 0, d[N << 1], l = 0, sg[N << 1], nn = 0;
bitset<N << 1> f[310], pd;
int main() {
  scanf("%d%d", &n, &w);
  for (int i = 1; i <= n; i++) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    d[++l] = y - x;
    d[++l] = z - y;
    nn = max(nn, max(y - x, z - y));
  }
  for (int i = 2; i <= nn; i++) {
    if (v[i] == 0) {
      pd[i] = 1;
      su[++tot] = i;
      for (int j = i; j <= nn; j += i) v[j] = 1;
    }
  }
  for (int i = 1; i <= tot; i++)
    for (int j = i + 1; j <= tot; j++) {
      if ((long long)su[i] * su[j] > (long long)nn) break;
      pd[su[i] * su[j]] = 1;
    }
  pd[w] = 0;
  f[0] = pd;
  for (int i = 1; i <= n; i++) {
    while (f[sg[i]][i]) sg[i]++;
    f[sg[i]] |= (pd << i);
  }
  int ans = 0;
  for (int i = 1; i <= l; i++) ans = ans ^ sg[d[i]];
  if (ans != 0)
    printf("Bob\nAlice");
  else
    printf("Alice\nBob");
  return 0;
}
