#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chkmin(T &a, const T &b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
inline bool chkmax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const int oo = 0x3f3f3f3f;
const int maxn = 200100;
bool pr[maxn + 5];
bool in[maxn + 5];
int sg[maxn + 5];
inline void prepare() {
  memset(in, 0, sizeof in);
  memset(pr, 1, sizeof pr);
  pr[0] = pr[1] = 0;
  for (int i = (2), i_end_ = (maxn + 1); i < i_end_; ++i)
    if (pr[i]) {
      in[i] = 1;
      for (int j = 1; i * j <= maxn; ++j) {
        if (pr[j]) in[i * j] = 1;
        pr[i * j] = 0;
      }
    }
}
vector<int> all[maxn + 5];
int main() {
  prepare();
  int n, ban;
  scanf("%d%d", &n, &ban);
  in[ban] = 0;
  sg[0] = 0;
  all[0].push_back(0);
  for (int i = (1), i_end_ = (maxn + 1); i < i_end_; ++i) {
    sg[i] = 0;
    while (1) {
      bool found = 0;
      for (int j = (int((all[sg[i]]).size())) - 1; j >= 0; --j)
        if (in[i - all[sg[i]][j]]) {
          found = 1;
          break;
        }
      if (!found) break;
      ++sg[i];
    }
    all[sg[i]].push_back(i);
  }
  int ans = 0;
  for (int i = (0), i_end_ = (n); i < i_end_; ++i) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    ans ^= sg[b - a - 1] ^ sg[c - b - 1];
  }
  fprintf(stderr, "%d\n", ans);
  puts(ans ? "Alice" : "Bob");
  puts(ans ? "Bob" : "Alice");
  return 0;
}
