#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  vector<int> v(200010, 0);
  v[0] = v[1] = 3;
  for (int p = (2); p < (200010); p++)
    if (v[p] == 0) {
      for (int i = p; i < 200010; i += p) {
        int aux = i;
        while (aux % p == 0) {
          v[i]++;
          aux /= p;
        }
      }
    }
  bitset<200010> bm, toGrundyFrom[100];
  vector<int> grundy(200010, 0);
  for (int i = (0); i < (200010); i++)
    if (v[i] < 3) bm.set(i);
  for (int i = (0); i < (200010); i++) {
    while (toGrundyFrom[grundy[i]][i]) grundy[i]++;
    toGrundyFrom[grundy[i]] |= bm << i;
  }
  int n, f, ans = 0;
  cin >> n >> f;
  v[f] = 3;
  for (int i = (0); i < (n); i++) {
    int a, b, c;
    cin >> a >> b >> c;
    ans ^= grundy[b - a - 1];
    ans ^= grundy[c - b - 1];
  }
  if (ans)
    cout << "Alice\nBob\n";
  else
    cout << "Bob\nAlice\n";
  return 0;
}
