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