#include <bits/stdc++.h>
#pragma GCC optimize("O2,unroll-loops")
using namespace std;
const int inf = 1000000010;
const long long INF = 10000000000000010LL;
const int mod = 1000000007;
const int MAXN = 100010, M = 110;
int n, m, k, u, v, x, y, z, a, b, ans;
int sieve[MAXN], G[MAXN];
bitset<MAXN> mark[M], A;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  for (int i = 2; i < MAXN; i++)
    if (!sieve[i])
      for (int j = i; j < MAXN; j += i) sieve[j] = i;
  sieve[1] = 1;
  cin >> n >> m;
  for (int i = 2; i < MAXN; i++)
    if (i != m) {
      int x = i;
      x /= sieve[x];
      x /= sieve[x];
      if (x == 1) A.set(i);
    }
  for (int i = 0; i < MAXN; i++) {
    while (mark[G[i]][i]) G[i]++;
    mark[G[i]] |= (A << i);
  }
  while (n--) {
    cin >> x >> y >> z;
    ans ^= G[y - x - 1];
    ans ^= G[z - y - 1];
  }
  cout << (ans ? "Alice" : "Bob") << "\n";
  cout << (!ans ? "Alice" : "Bob") << "\n";
  return 0;
}
