#include <bits/stdc++.h>
const int MAX = 200010;
int n, m, f, a[MAX], pr[MAX], pc, g[MAX];
int com[MAX], vis[MAX], tmp[MAX];
std::vector<int> list[111];
bool mp[MAX];
int main() {
  scanf("%d%d", &n, &f);
  for (int i = 0, b, w, r; i < n; i++) {
    scanf("%d%d%d", &b, &w, &r);
    a[i * 2] = w - b - 1;
    a[i * 2 + 1] = r - w - 1;
  }
  for (int i = 0; i < n * 2; i++)
    if (a[i] > m) m = a[i];
  for (int i = 2; i <= m; i++) {
    if (!com[i]) pr[pc++] = i;
    if (i != f && (!com[i] || !com[com[i]])) mp[i] = 1;
    for (int j = 0; j < pc && i * pr[j] <= m; j++) {
      com[i * pr[j]] = i;
      if (i % pr[j] == 0) break;
    }
  }
  list[0].push_back(0);
  for (int i = 1; i <= m; i++) {
    for (;; g[i]++) {
      bool fl = 1;
      int sz = list[g[i]].size();
      for (int l = 0, r = sz - 1; l <= r && fl; l++, r--)
        if (mp[i - list[g[i]][l]] || mp[i - list[g[i]][r]]) fl = 0;
      if (fl) break;
    }
    list[g[i]].push_back(i);
  }
  int ans = 0;
  for (int i = 0; i < n * 2; i++) ans ^= g[a[i]];
  if (ans)
    puts("Alice\nBob");
  else
    puts("Bob\nAlice");
}
