#include <bits/stdc++.h>
using namespace std;
const int N = 2e6, INF = 998244353;
int n, f, g[N], cnt[N];
vector<int> a, p, q;
bitset<N> u, t;
int grandi(int x) {
  if (g[x] != -1) return g[x];
  unordered_set<int> s;
  for (int i = 0; i < q.size() && x - q[i] >= 0; i++) s.insert(g[x - q[i]]);
  for (g[x] = 0;; g[x]++)
    if (s.find(g[x]) == s.end()) return g[x];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> f;
  for (int i = 0; i < n; i++) {
    int b, w, r;
    cin >> b >> w >> r;
    cnt[w - b - 1]++;
    cnt[r - w - 1]++;
  }
  for (int i = 0; i <= 200000; i++)
    if (cnt[i] % 2) a.push_back(i);
  for (long long i = 2; i <= a.back(); i++) {
    g[i] = -1;
    if (!u[i]) {
      p.push_back(i);
      for (long long j = i * i; j <= a.back(); j += i) u[j] = 1;
    }
  }
  for (int i = 0; i < p.size(); i++) {
    t[p[i]] = 1;
    for (int j = i; j < p.size() && (long long)p[i] * p[j] <= a.back(); j++)
      t[p[i] * p[j]] = 1;
  }
  for (int i = 2; i <= a.back(); i++)
    if (t[i] && i != f) q.push_back(i);
  int s = 0;
  for (auto i : a) s ^= grandi(i);
  if (s)
    cout << "Alice" << endl << "Bob" << endl;
  else
    cout << "Bob" << endl << "Alice" << endl;
  return 0;
}
