#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
const int MAX_N = 200000;
int N, F, dp[MAX_N + 9], V[MAX_N + 9];
bool used[200009];
void init() {
  for (int i = 2; i <= MAX_N; i++) {
    int deg = 0;
    for (int j = 1; j * j <= i; j++) {
      if (i % j != 0) continue;
      deg++;
      if (j * j != i) deg++;
    }
    V[i] = deg;
    if (deg <= 4) used[i] = true;
  }
  used[F] = false;
  for (int i = 2; i <= 100; i++) {
    int S = i * i * i;
    if (V[i] == 2 && S <= MAX_N) used[S] = false;
  }
  for (int i = 1; i <= MAX_N; i++) {
    int mex[250];
    for (int j = 0; j < 250; j++) mex[j] = 0;
    for (int j = 1; j <= min(3000, i); j++) {
      if (used[j] == true) mex[dp[i - j]] = 1;
    }
    for (int j = 0; j <= min(3000, i - 1); j++) {
      if (used[i - j] == true) mex[dp[j]] = 1;
    }
    for (int j = 0; j < 250; j++) {
      if (mex[j] == 0) {
        dp[i] = j;
        break;
      }
    }
  }
}
int main() {
  scanf("%d%d", &N, &F);
  init();
  int V = 0;
  for (int i = 1; i <= N; i++) {
    int p1, p2, p3;
    scanf("%d%d%d", &p1, &p2, &p3);
    V ^= dp[p2 - p1 - 1];
    V ^= dp[p3 - p2 - 1];
  }
  if (V == 0) {
    cout << "Bob" << endl;
    cout << "Alice" << endl;
  } else {
    cout << "Alice" << endl;
    cout << "Bob" << endl;
  }
  return 0;
}
