#include <bits/stdc++.h>
using namespace std;
static inline void canhazfast() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
}
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T extgcd(T a, T b, T &x, T &y) {
  T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
  while (b) {
    T q = a / b;
    a %= b;
    swap(a, b);
    x0 -= q * x1;
    swap(x0, x1);
    y0 -= q * y1;
    swap(y0, y1);
  }
  x = x0;
  y = y0;
  return a;
}
int ctz(unsigned x) { return __builtin_ctz(x); }
int ctzll(unsigned long long x) { return __builtin_ctzll(x); }
int clz(unsigned x) { return __builtin_clz(x); }
int clzll(unsigned long long x) { return __builtin_clzll(x); }
int popcnt(unsigned x) { return __builtin_popcount(x); }
int popcntll(unsigned long long x) { return __builtin_popcountll(x); }
int bsr(unsigned x) { return 31 ^ clz(x); }
int bsrll(unsigned long long x) { return 63 ^ clzll(x); }
int nimb[200000];
int x[100016], y[100016];
bitset<200000> u[30];
bitset<200000> moves;
bitset<200000> sieve;
int main() {
  canhazfast();
  int n, f, m = 0, ans = 0;
  vector<int> primes(1, 2);
  cin >> n >> f;
  for (int i = 0; i < n; ++i) {
    int b, w, r;
    cin >> b >> w >> r;
    x[i] = w - b - 1;
    y[i] = r - w - 1;
    m = max(m, max(x[i], y[i]));
  }
  moves[2] = true;
  for (int i = 3; i <= m; i += 2) {
    if (sieve[i]) continue;
    primes.push_back(i);
    moves[i] = true;
    for (long long j = (long long)i * i; j <= m; j += 2 * i) sieve[j] = true;
    for (int p : primes) {
      if ((long long)i * p > m) break;
      moves[i * p] = true;
    }
  }
  moves[f] = false;
  for (int i = 0; i <= m; ++i) {
    int j = 0;
    while (u[j][i]) ++j;
    nimb[i] = j;
    u[j] |= moves << i;
  }
  for (int i = 0; i < n; ++i) {
    ans ^= nimb[x[i]];
    ans ^= nimb[y[i]];
  }
  cout << (ans ? "Alice\nBob\n" : "Bob\nAlice\n");
  return 0;
}
