#include <bits/stdc++.h>
using namespace std;
bitset<200001> validMoves, grundies[105];
int grundyValues[200001];
bool isPrime[200001];
vector<string> players{"Alice", "Bob"};
void PreProcess(int m) {
  vector<int> primes;
  for (int i = 2; i < 200001; ++i) {
    isPrime[i] = 1;
  }
  validMoves.reset();
  for (int i = 2; i < 200001; ++i) {
    if (!isPrime[i]) {
      continue;
    }
    for (int j = i + i; j < 200001; j += i) {
      isPrime[j] = 0;
    }
    primes.push_back(i);
    for (int prime : primes) {
      if (i * prime >= 200001) {
        break;
      }
      validMoves.set(i * prime);
    }
    validMoves.set(i);
  }
  for (int k = 0; k < 105; ++k) {
    grundies[k].reset();
  }
  grundies[0].set(0);
  for (int i = 1; i < 200001; ++i) {
    int &k = grundyValues[i];
    for (; grundies[k].test(i); ++k)
      ;
    grundies[k] |= (validMoves << i);
  }
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  PreProcess(m);
  int ans = 0;
  while (n--) {
    int b, w, r;
    scanf("%d%d%d", &b, &w, &r);
    ans ^= grundyValues[w - b - 1];
    ans ^= grundyValues[r - w - 1];
  }
  ans = (ans == 0) ? 1 : 0;
  for (int i = 0; i < players.size(); ++i) {
    cout << players[i ^ ans] << '\n';
  }
  return 0;
}
