#include <bits/stdc++.h>
const int N = 200000, K = 64;
std::bitset<N> step, numbers[K];
int n, f, sg[N];
int md[N], pr[N / 10], pt;
bool ok(int n) { return md[n] == n || md[n / md[n]] == n / md[n]; }
void sieve(int n) {
  for (int i = 2; i <= n; ++i) {
    if (!md[i]) md[i] = i, pr[++pt] = i;
    for (int j = 1, t; j <= pt && pr[j] <= md[i]; ++j) {
      if ((t = i * pr[j]) > n) break;
      md[t] = pr[j];
    }
  }
  for (int i = 2; i <= n; ++i)
    if (ok(i) && i != f) step.set(i);
}
int main() {
  std::ios::sync_with_stdio(0), std::cin.tie(0);
  std::cin >> n >> f, sieve(N - 1);
  for (int i = 0; i < N; ++i) {
    for (int j = 0; numbers[j].test(i); ++j) ++sg[i];
    numbers[sg[i]] |= step << i;
  }
  int nimber = 0;
  for (int i = 0; i < n; ++i) {
    int x, y, z;
    std::cin >> x >> y >> z;
    z = z - y - 1, x = y - x - 1;
    nimber ^= sg[x] ^= sg[z];
  }
  std::cout << (nimber ? "Alice\nBob\n" : "Bob\nAlice\n");
  return 0;
}
