#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn = 4e5 + 100;
int MAX = 2e5 + 10;
int good[maxn], b[maxn], gs = 0;
pair<int, int> a[maxn];
int f;
int rem[maxn];
void myinit() {
  cin >> n >> f;
  for (int i = 1; i <= n; i++) {
    int blue, white, red;
    cin >> blue >> white >> red;
    a[i] = make_pair(white - blue, red - white);
  }
}
void get_good() {
  for (int i = 2; i <= MAX; i++) {
    if (!b[i]) {
      good[++gs] = i;
      for (int j = i + i; j <= MAX; j += i) {
        b[j] = true;
      }
    }
  }
  int tmp = gs;
  for (int i = 1; i <= tmp; i++) {
    if ((long long)good[i] * good[i] > (long long)MAX) break;
    for (int j = i; j <= tmp; j++) {
      if ((long long)((long long)good[i] * good[j]) <= (long long)MAX)
        good[++gs] = good[i] * good[j];
      else
        break;
    }
  }
  sort(good + 1, good + 1 + gs);
}
int grundy(int x) {
  if (rem[x] >= 0) return rem[x];
  set<int> se;
  se.clear();
  for (int i = 1; i <= gs; i++) {
    if (f == good[i]) continue;
    if (x < good[i]) break;
    se.insert(grundy(x - good[i]));
  }
  int t = 0;
  while (se.count(t)) t++;
  return rem[x] = t;
}
bool vis[105];
void get_grundy() {
  for (int i = 1; i <= 10000; i++) {
    memset(vis, 0, sizeof(vis));
    set<int> se;
    se.clear();
    for (int j = 1; j <= gs; j++) {
      if (good[j] == f) continue;
      if (good[j] > i) break;
      vis[rem[i - good[j]]] = true;
    }
    int t = 0;
    while (vis[t]) t++;
    rem[i] = t;
  }
}
int main() {
  myinit();
  get_good();
  get_grundy();
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = ans ^ rem[a[i].first - 1] ^ rem[a[i].second - 1];
  }
  if (ans == 0) {
    cout << "Bob\nAlice\n";
  } else {
    cout << "Alice\nBob\n";
  }
  return 0;
}
