#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const long long longinf = 1LL << 60;
const long long mod = 1e9 + 7;
int dp[202020];
vector<int> v;
int main() {
  int n, f;
  cin >> n >> f;
  int s = 202020;
  bool isprime[202020];
  for (int i = (int)0; i < (int)s; ++i) isprime[i] = true;
  isprime[0] = isprime[1] = false;
  vector<int> prime;
  for (int i = (int)0; i < (int)s; ++i) {
    if (!isprime[i]) continue;
    prime.push_back(i);
    for (int j = 2 * i; j < s; j += i) {
      isprime[j] = false;
    }
  }
  s = prime.size();
  for (int i = (int)0; i < (int)s; ++i) {
    if (prime[i] != f) v.push_back(prime[i]);
    for (int j = (int)i; j < (int)s; ++j) {
      long long x = (long long)prime[i] * prime[j];
      if (x > 202020) break;
      if (x != f) v.push_back(x);
    }
  }
  sort(v.begin(), v.end());
  for (int i = 1; i < 2000; ++i) {
    vector<int> res;
    for (int j = (int)0; j < (int)v.size(); ++j) {
      if (i < v[j]) break;
      res.push_back(dp[i - v[j]]);
    }
    if (res.empty()) continue;
    sort(res.begin(), res.end());
    res.erase(unique(res.begin(), res.end()), res.end());
    res.push_back(inf);
    int ret = 0;
    int j = 0;
    while (ret == res[j]) {
      j++;
      ret++;
    }
    dp[i] = j;
  }
  int ans = 0;
  for (int i = (int)0; i < (int)n; ++i) {
    int x, y, z;
    cin >> x >> y >> z;
    ans ^= dp[y - x - 1];
    ans ^= dp[z - y - 1];
  }
  if (ans) {
    cout << "Alice" << endl << "Bob" << endl;
  } else {
    cout << "Bob" << endl << "Alice" << endl;
  }
  return 0;
}
