#include <bits/stdc++.h>
using namespace std;
const int N = 100100, M = 150;
bitset<N> ori, bit[M];
int gr[N], n, f, vis[N];
int main(void) {
  scanf("%d%d", &n, &f);
  vis[1] = 1;
  for (int i = 2; i < N; i++) {
    if (!vis[i]) {
      for (int j = i; j < N; j += i) {
        vis[j] = i;
      }
    }
  }
  for (int i = 2; i < N; i++) {
    if (vis[i] == i || vis[i / vis[i]] == i / vis[i]) {
      ori.set(i);
    }
  }
  ori[f] = 0;
  for (int i = 0; i < N; i++) {
    while (bit[gr[i]].test(i)) {
      gr[i]++;
    }
    bit[gr[i]] |= ori << i;
  }
  int ans = 0;
  while (n--) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    ans ^= gr[b - a - 1] ^ gr[c - b - 1];
  }
  if (ans) {
    printf("Alice\nBob\n");
  } else {
    printf("Bob\nAlice\n");
  }
  return 0;
}
