#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e5 + 7;
const int MAXS = (int)103;
const int MOD = (int)1e9 + 7;
const int infint = (int)1e8 + 3;
const long long inf = (long long)1e18;
int n, f, big[MAXN], grundy[MAXN], pr[MAXN];
bitset<MAXN> cur[MAXS], all;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> f;
  for (int i = 2; i < MAXN; i++)
    if (big[i] == 0)
      for (int j = i; j < MAXN; j += i) big[j] = i;
  for (int i = 2; i < MAXN; i++)
    pr[i] = pr[i / big[i]] + 1, all[i] = (pr[i] <= 2 && i != f);
  cur[0] = all;
  for (int i = 1; i < MAXN; i++) {
    while (cur[grundy[i]][i]) grundy[i]++;
    cur[grundy[i]] |= all << i;
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    ans ^= grundy[b - a - 1], ans ^= grundy[c - b - 1];
  }
  if (ans == 0)
    cout << "Bob\nAlice";
  else
    cout << "Alice\nBob";
}
