#include <bits/stdc++.h>
template <typename T>
class IntegerIterator {
 public:
  using value_type = T;
  using difference_type = std::ptrdiff_t;
  using pointer = T*;
  using reference = T;
  using iterator_category = std::input_iterator_tag;
  explicit IntegerIterator(T value) : value(value) {}
  IntegerIterator& operator++() {
    ++value;
    return *this;
  }
  IntegerIterator operator++(int) {
    IntegerIterator copy = *this;
    ++value;
    return copy;
  }
  IntegerIterator& operator--() {
    --value;
    return *this;
  }
  IntegerIterator operator--(int) {
    IntegerIterator copy = *this;
    --value;
    return copy;
  }
  T operator*() const { return value; }
  bool operator==(IntegerIterator rhs) const { return value == rhs.value; }
  bool operator!=(IntegerIterator rhs) const { return !(*this == rhs); }

 private:
  T value;
};
template <typename T>
class IntegerRange {
 public:
  IntegerRange(T begin, T end) : begin_(begin), end_(end) { ; }
  IntegerIterator<T> begin() const { return IntegerIterator<T>(begin_); }
  IntegerIterator<T> end() const { return IntegerIterator<T>(end_); }

 private:
  T begin_;
  T end_;
};
template <typename T>
class ReversedIntegerRange {
  using IteratorType = std::reverse_iterator<IntegerIterator<T>>;

 public:
  ReversedIntegerRange(T begin, T end) : begin_(begin), end_(end) { ; }
  IteratorType begin() const {
    return IteratorType(IntegerIterator<T>(begin_));
  }
  IteratorType end() const { return IteratorType(IntegerIterator<T>(end_)); }

 private:
  T begin_;
  T end_;
};
template <typename T>
IntegerRange<T> range(T to) {
  return IntegerRange<T>(0, to);
}
template <typename T>
IntegerRange<T> range(T from, T to) {
  return IntegerRange<T>(from, to);
}
template <typename T>
IntegerRange<T> inclusiveRange(T to) {
  return IntegerRange<T>(0, to + 1);
}
template <typename T>
IntegerRange<T> inclusiveRange(T from, T to) {
  return IntegerRange<T>(from, to + 1);
}
template <typename T>
ReversedIntegerRange<T> downrange(T from) {
  return ReversedIntegerRange<T>(from, 0);
}
template <typename T>
ReversedIntegerRange<T> downrange(T from, T to) {
  return ReversedIntegerRange<T>(from, to);
}
template <typename T>
ReversedIntegerRange<T> inclusiveDownrange(T from) {
  return ReversedIntegerRange<T>(from + 1, 0);
}
template <typename T>
ReversedIntegerRange<T> inclusiveDownrange(T from, T to) {
  return ReversedIntegerRange<T>(from + 1, to);
}
struct Bool {
  Bool() = default;
  Bool(bool value) : value(value) {}
  operator bool() const { return value; }

 private:
  bool value;
};
bool isPrime(int n) {
  for (int i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      return false;
    }
  }
  return n >= 2;
}
bool isPrime(int64_t n) {
  for (int64_t i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      return false;
    }
  }
  return n >= 2;
}
std::vector<Bool> primeMap(std::size_t maxN) {
  std::vector<Bool> prime(maxN + 1, true);
  prime[0] = false;
  prime[1] = false;
  for (std::size_t i = 2; i * i <= maxN; ++i) {
    if (prime[i]) {
      if (i * 1ULL * i <= maxN) {
        for (std::size_t j = i * i; j <= maxN; j += i) {
          prime[j] = false;
        }
      }
    }
  }
  return prime;
}
std::vector<int> allPrimes(int maxN) {
  std::vector<int> result;
  result.reserve(maxN);
  std::vector<Bool> map = primeMap(maxN);
  for (int i : range(maxN + 1)) {
    if (map[i]) {
      result.push_back(i);
    }
  }
  return result;
}
int nextPrime(int n) {
  while (!isPrime(n)) {
    ++n;
  }
  return n;
}
template <typename T>
void updateMin(T& oldValue, const T& newValue) {
  if (newValue < oldValue) {
    oldValue = newValue;
  }
}
template <typename T>
void updateMax(T& oldValue, const T& newValue) {
  if (oldValue < newValue) {
    oldValue = newValue;
  }
}
using namespace std;
class HNoviiGodITrikolor {
 public:
  static constexpr int kStressCount = 0;
  static void generateTest(std::ostream& test) {}
  void solve(std::istream& in, std::ostream& out) {
    int MX = 200000;
    int n;
    in >> n;
    int f;
    in >> f;
    auto pr = allPrimes(MX);
    vector<int> val;
    for (int p : pr) {
      val.push_back(p);
      for (int q : pr) {
        if (q > p) {
          break;
        }
        if (p * q > MX) {
          break;
        }
        val.push_back(p * q);
      }
    }
    sort(val.begin(), val.end());
    auto it = find(val.begin(), val.end(), f);
    if (it != val.end()) {
      val.erase(it);
    }
    vector<int> gr(MX + 1);
    array<int, 50> vals{};
    for (int i : range(MX + 1)) {
      int v = 0;
      for (int t : val) {
        if (t > i) {
          break;
        }
        vals[gr[i - t]] = i;
      }
      while (val[v] == i) {
        ++v;
      }
      gr[i] = v;
    }
    int ans = 0;
    for (int i : range(n)) {
      int r, w, b;
      in >> r >> w >> b;
      ans ^= gr[b - w - 1];
      ans ^= gr[w - r - 1];
    }
    out << ((ans == 0) ? "Bob\nAlice" : "Alice\nBob") << "\n";
  }
};
int main() {
  std::ios_base::sync_with_stdio(false);
  HNoviiGodITrikolor solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  in.tie(nullptr);
  out << std::fixed;
  out.precision(20);
  solver.solve(in, out);
  return 0;
}
