#include <bits/stdc++.h>
using namespace std;
const int MN = 200010;
vector<int> pr, mov;
int pchk[MN];
void sieve() {
  for (int i = 2; i < MN; i++) {
    if (!pchk[i]) {
      pr.push_back(i);
    }
    for (int j = 0; j < pr.size() && i * pr[j] < MN; j++) {
      pchk[i * pr[j]] = pr[j];
      if (i % pr[j] == 0) break;
    }
  }
  for (int i = 2; i < MN; i++) {
    if (!pchk[i] || !pchk[i / pchk[i]]) {
      mov.push_back(i);
    }
  }
}
int N, F;
bitset<MN> filter, check[100];
int dp[MN];
int main() {
  sieve();
  scanf("%d %d", &N, &F);
  for (int i = 0; i < mov.size(); i++) {
    if (mov[i] == F) continue;
    filter[mov[i]] = 1;
  }
  dp[0] = 1;
  check[0] = filter;
  for (int i = 1; i < MN; i++) {
    for (int j = 0; j < 100; j++) {
      if (!check[j][i]) {
        dp[i] = j;
        break;
      }
    }
    check[dp[i]] |= filter << i;
  }
  int Xor = 0;
  for (int i = 0; i < N; i++) {
    int b, w, r;
    scanf("%d %d %d", &b, &w, &r);
    Xor ^= dp[w - b - 1];
    Xor ^= dp[r - w - 1];
  }
  if (Xor)
    printf("Alice\nBob");
  else
    printf("Bob\nAlice");
}
