#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 200100, md = 998244353;
long long l[MAXN];
vector<long long> primes;
bool sieve[MAXN];
long long sg[MAXN];
bitset<MAXN> bit[100], P;
void init(long long N) {
  for (long long i = 2; i < N; i++) {
    if (!sieve[i]) {
      for (long long j = i * i; j < N; j += i) {
        sieve[j] = 1;
      }
      primes.push_back(i);
      P.set(i);
    }
  }
  long long sz = primes.size();
  for (long long i = 0; i < sz; i++)
    for (long long j = i; j < sz && primes[i] * primes[j] < MAXN; j++)
      P.set(primes[i] * primes[j]);
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long n, f, x, y, z;
  cin >> n >> f;
  init(MAXN);
  P.set(f, false);
  for (long long i = 0; i < MAXN; i++) {
    while (bit[sg[i]][i]) sg[i]++;
    bit[sg[i]] |= (P << i);
  }
  long long cur = 0;
  for (long long i = 0; i < n; i++) {
    cin >> x >> y >> z;
    cur ^= sg[z - y - 1] ^ sg[y - x - 1];
  }
  cout << (cur ? "Alice\nBod\n" : "Bob\nAlice\n");
}
