#include <bits/stdc++.h>
using namespace std;
int t, n, k;
int main(void) {
  ios_base::sync_with_stdio(false);
  ;
  cin >> t;
  while (t--) {
    cin >> n >> k;
    if (k % 3 != 0) {
      cout << (n % 3 == 0 ? "Bob" : "Alice") << endl;
    } else {
      int r = n % (k + 1);
      if (r == k) {
        cout << "Alice" << endl;
      } else {
        cout << (r % 3 == 0 ? "Bob" : "Alice") << endl;
      }
    }
  }
  return 0;
}
