#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
int p[N + 5], sg[N + 5], n, f, x, y, z, ans, cnt = 0;
bitset<N + 5> lv1, lv[100];
int main() {
  for (int i = (2); i <= (N); ++i) p[i] = i;
  for (int i = (2); i <= (N); ++i) {
    for (int j = (i); j <= (N / i); ++j) p[j * i] = p[i];
    x = i / p[i];
    if (x == 1 || x == p[x]) lv1[x] = 1;
  }
  scanf("%d%d", &n, &f);
  lv1[f] = 0;
  for (int i = (0); i <= (N); ++i) {
    while (lv[sg[i]][i]) ++sg[i];
    lv[sg[i]] |= lv1 << i;
  }
  for (int i = (1); i <= (n); ++i)
    scanf("%d%d%d", &x, &y, &z), ans ^= sg[y - x - 1] ^ sg[z - y - 1];
  puts(ans ? "Alice\nBob\n" : "Bob\nAlice\n");
  return 0;
}
