#include <bits/stdc++.h>
using namespace std;
template <class T>
using vv = vector<vector<T>>;
template <class T>
ostream &operator<<(ostream &os, const deque<T> &t) {
  os << "{";
  for (int(i) = 0; (i) < (t.size()); ++(i)) {
    os << t[i] << ",";
  }
  os << "}" << endl;
  return os;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &t) {
  os << "{";
  for (int(i) = 0; (i) < (t.size()); ++(i)) {
    os << t[i] << ",";
  }
  os << "}" << endl;
  return os;
}
template <class T, size_t n>
ostream &operator<<(ostream &os, const array<T, n> &t) {
  os << "{";
  for (int(i) = 0; (i) < (n); ++(i)) {
    os << t[i] << ",";
  }
  os << "}" << endl;
  return os;
}
template <class S, class T>
ostream &operator<<(ostream &os, const pair<S, T> &t) {
  return os << "(" << t.first << "," << t.second << ")";
}
template <class S, class T, class U>
ostream &operator<<(ostream &os, const tuple<S, T, U> &t) {
  return os << "(" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << ")";
}
template <class S, class T, class U, class V>
ostream &operator<<(ostream &os, const tuple<S, T, U, V> &t) {
  return os << "(" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << ","
            << get<3>(t) << ")";
}
template <class S, class T, class U, class V, class W>
ostream &operator<<(ostream &os, const tuple<S, T, U, V, W> &t) {
  return os << "(" << get<0>(t) << "," << get<1>(t) << "," << get<2>(t) << ","
            << get<3>(t) << "," << get<4>(t) << ")";
}
template <class T>
inline bool MX(T &l, const T &r) {
  return l < r ? l = r, 1 : 0;
}
template <class T>
inline bool MN(T &l, const T &r) {
  return l > r ? l = r, 1 : 0;
}
const long long MOD = 1e9 + 7;
vector<int> primes, prime;
class PRPRPR {
 public:
  PRPRPR(int PRIME_MAX) {
    prime.resize(PRIME_MAX);
    for (int i = 2; i < PRIME_MAX; i++)
      if (!prime[i]) {
        primes.push_back(i);
        for (int j = i * 2; j < PRIME_MAX; j += i) prime[j] = 1;
      }
  }
} prprprpr(212345);
bitset<212345> A, B;
int main() {
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(0);
  vector<int> ok(212345);
  for (int p : primes) {
    ok[p] = 1;
    for (int q : primes) {
      if (1ll * p * q > 202345) break;
      ok[p * q] = 1;
    }
  }
  int n, f;
  cin >> n >> f;
  A.reset();
  B.reset();
  for (int(i) = 2; (i) < (212345); ++(i)) {
    if (ok[i] && i != f) {
      A[i] = 1;
    }
  }
  for (int(i) = 2; (i) < (202345); ++(i)) {
    if (ok[i] && i != f) {
      B |= A << i;
    }
  }
  vector<int> gr(212345);
  for (int(i) = 2; (i) < (202345); ++(i)) {
    if (A[i])
      gr[i] = 1;
    else if (B[i])
      gr[i] = 2;
    else
      gr[i] = 3;
  }
  int p = 0;
  for (int(i) = 0; (i) < (n); ++(i)) {
    int a, b, c;
    cin >> a >> b >> c;
    p ^= gr[b - a] ^ gr[c - b];
  }
  string al = "Alice";
  string bo = "Bob";
  if (!p) swap(al, bo);
  cout << al << endl << bo << endl;
  return 0;
}
