#include <bits/stdc++.h>
using namespace std;
int n, f;
int divs[2 * 100123] = {}, grundy[2 * 100123] = {};
bool valid[2 * 100123] = {};
vector<int> nums;
vector<int> grouped[2 * 100123];
int main() {
  ios_base::sync_with_stdio(false);
  for (int d = 2; d < 2 * 100123; d++) {
    if (divs[d] == 0)
      for (int v = d; v < 2 * 100123; v += d) divs[v] = d;
    if (d == f) continue;
    if (divs[d] == d || divs[d / divs[d]] == d / divs[d]) {
      valid[d] = true;
    }
  }
  grouped[0].push_back(0);
  grundy[0] = 0;
  for (int v = 1; v < 2 * 100123; v++) {
    grundy[v] = 0;
    while (((grouped[grundy[v]]).size()) > 0) {
      bool found = false;
      for (int i = 0; i < (((grouped[grundy[v]]).size())); i++)
        if (valid[v - grouped[grundy[v]][i]]) {
          found = true;
          break;
        }
      if (!found) break;
      grundy[v]++;
    }
    grouped[grundy[v]].push_back(v);
  }
  int sum = 0, b, w, r;
  cin >> n >> f;
  for (int i = 0; i < (n); i++) {
    cin >> b >> w >> r;
    sum ^= grundy[w - b - 1] ^ grundy[r - w - 1];
  }
  cout << ((sum != 0) ? "Alice" : "Bob") << endl;
  cout << ((sum == 0) ? "Alice" : "Bob") << endl;
  return 0;
}
