#include <bits/stdc++.h>
using namespace std;
int n, g[200005], f, x[3];
bool np[200005];
vector<int> p, pp;
bitset<200005> bs[30], bb;
int s[200005], ans;
int main() {
  for (int i = 2; i < 200005; i++)
    if (!np[i]) {
      p.push_back(i);
      for (long long j = (long long)i * i; j < 200005; j += i) np[j] = 1;
    }
  for (int i = 0; i < p.size(); i++)
    for (int j = i; j < p.size() && (long long)p[i] * p[j] < 200005; j++)
      np[p[i] * p[j]] = 0;
  scanf("%d%d", &n, &f);
  np[f] = 1;
  for (int i = 2; i < 200005; i++)
    if (!np[i]) {
      pp.push_back(i);
      bb[i] = 1;
    }
  pp.push_back(INT_MAX);
  for (int i = 1; i < 200005; i++) {
    while (bs[g[i]][i]) g[i]++;
    bb <<= 1;
    bs[g[i]] |= bb;
  }
  int ma = 0;
  for (int i = 1; i < 200005; i++) ma = max(ma, g[i]);
  printf("ma = %d\n", ma);
  while (n--) {
    for (int i = 0; i < 3; i++) scanf("%d", x + i);
    x[2] -= x[1] + 1;
    x[1] -= x[0] + 1;
    ans ^= g[x[1]] ^ g[x[2]];
  }
  if (ans)
    printf("Alice\nBob\n");
  else
    printf("Bob\nAlice\n");
  return 0;
}
