#include <bits/stdc++.h>
using namespace std;
int t, n, k;
int calculateMex(unordered_set<int> Set) {
  int Mex = 0;
  while (Set.find(Mex) != Set.end()) Mex++;
  return (Mex);
}
int calculateGrundy(int n) {
  if (n == 0) return (0);
  if (n == 1) return (1);
  if (n == 2) return (2);
  if (n == k) return (k);
  unordered_set<int> Set;
  Set.insert(calculateGrundy(n - 1));
  Set.insert(calculateGrundy(n - 2));
  if (n >= k) Set.insert(calculateGrundy(n - k));
  return (calculateMex(Set));
}
int main() {
  k = 3;
  cin >> t;
  for (; t; t--) {
    cin >> n >> k;
    if (k == n) {
      cout << "Alice\n";
      continue;
    }
    if (k > n || k % 3) {
      if (n % 3 == 0)
        cout << "Bob\n";
      else
        cout << "Alice\n";
      continue;
    }
    if ((n % (k + 1)) % 3 == 0 && n % (k + 1) != k)
      cout << "Bob\n";
    else
      cout << "Alice\n";
  }
  return (0);
}
