#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200200, MaxGrundy = 32;
vector<int> deltas, grundy;
vector<bool> isPrime;
bitset<MAXN> sets[MaxGrundy];
void fill() {
  isPrime.resize(MAXN, true);
  isPrime[0] = isPrime[1] = false;
  for (int i = 2; i < MAXN; i++) {
    if (isPrime[i]) {
      deltas.push_back(i);
      for (int j = i + i; j < MAXN; j += i) isPrime[j] = false;
    }
  }
  int p1 = (int)deltas.size();
  for (int i = 0; i < p1; i++) {
    for (int j = i; j < p1; j++) {
      long long int val = (long long int)deltas[i] * deltas[j];
      if (val > MAXN) break;
      deltas.push_back((int)val);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  fill();
  bitset<MAXN> moves;
  for (int x : deltas) {
    sets[0][x] = 1;
    moves[x] = 1;
  }
  int N, F;
  cin >> N >> F;
  sets[0][F] = 0;
  grundy.resize(MAXN, 0);
  for (int i = 1; i < MAXN; i++) {
    while (sets[grundy[i]][i]) {
      grundy[i]++;
    }
    sets[grundy[i]] |= moves << i;
  }
  int totXor = 0;
  while (N--) {
    int blue, white, red;
    cin >> blue >> white >> red;
    int pile1 = white - blue - 1;
    int pile2 = red - white - 1;
    totXor ^= grundy[pile1];
    totXor ^= grundy[pile2];
  }
  string res[2] = {"Alice", "Bob"};
  int pos = 0;
  if (totXor == 0) pos = 1;
  cout << res[pos] << "\n";
  cout << res[pos ^ 1] << "\n";
  return 0;
}
