#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long w = 0, f = 1;
  char c = ' ';
  while (c < '0' || c > '9') c = getchar(), f = c == '-' ? -1 : f;
  while (c >= '0' && c <= '9') w = w * 10 + c - 48, c = getchar();
  return w * f;
}
long long pri[200005], cnt;
bool vis[200005];
bitset<200005> a[30], base;
void init() {
  for (long long i = 2; i < 200005; i++)
    if (!vis[i]) {
      pri[++cnt] = i;
      for (long long j = 2; i * j < 200005; j++) vis[i * j] = 1;
    }
  for (long long i = 1; i <= cnt; i++) {
    base[pri[i]] = 1;
    for (long long j = i; j <= cnt; j++) {
      if (pri[i] * pri[j] >= 200005) break;
      base[pri[i] * pri[j]] = 1;
    }
  }
}
long long get_sg(long long x) {
  for (long long i = 0; i < 200005; i++)
    if (!a[i][x]) return i;
  return (long long)'z' * 'z' * 'c' * 'a' * 'k' * 'i' * 'o' * 'i';
}
long long n, f, sg[200005], ans;
signed main() {
  init();
  n = read(), f = read();
  base[f] = 0, a[0] = base;
  for (long long i = 1; i < 200005; i++) {
    sg[i] = get_sg(i);
    a[sg[i]] |= base << i;
  }
  long long x, y, z;
  for (long long i = 1; i <= n; i++) {
    x = read(), y = read(), z = read();
    ans ^= sg[y - x - 1], ans ^= sg[z - y - 1];
  }
  if (ans)
    puts("Alice\nBob");
  else
    puts("Bob\nAlice");
  return 0;
}
