#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 111;
const long long llinf = (long long)3e18;
const int N = (int)2e5 + 111;
const long double PI = (long double)acos(-1);
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int p, k;
    cin >> p >> k;
    bool win = true;
    if (k % 3 == 0) {
      int rm = p % (k + 1);
      if (rm % 3 == 0 & rm != k) win = false;
    } else {
      if (p % 3 == 0) win = false;
    }
    cout << ((win) ? "Alice" : "Bob") << endl;
  }
  return 0;
}
