#include <bits/stdc++.h>
using namespace std;
const long long inf = 0xFFFFFFFFFFFFFFFL;
const long long mod = 1000000007L;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    if (k % 3 == 0) {
      long long mx = n / (k + 1);
      long long mn;
      if (n + 3 >= k) {
        mn = ((n + 3 - k) % (k + 1) == 0) ? ((n + 3 - k) / (k + 1))
                                          : ((n + 3 - k) / (k + 1) + 1);
      } else {
        mn = 0;
      }
      if (mn < 0) {
        mn = 0;
      }
      if (mn > mx) {
        cout << "Alice" << endl;
      } else {
        long long ans = false;
        for (long long i = mn; i <= mx; i++) {
          if ((n - (k + 1) * i) % 3 == 0) {
            ans = true;
            break;
          }
        }
        if (ans) {
          cout << "Bob" << endl;
        } else {
          cout << "Alice" << endl;
        }
      }
    } else {
      if (n % 3 == 0) {
        cout << "Bob" << endl;
      } else {
        cout << "Alice" << endl;
      }
    }
  }
  return 0;
}
