#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
const int INF = 2e9 + 179, MOD = 1e9 + 7;
const long long int BIGINF = 2e18 + 179;
const long double EPS = 0.000001;
using namespace std;
int solve(int test) {
  int n, k;
  cin >> n >> k;
  if (n == 0) {
    cout << "Bob"
         << "\n";
    return 0;
  }
  if (n < 3 || n == k) {
    cout << "Alice"
         << "\n";
    return 0;
  }
  if (k % 3 == 0) {
    if ((n % (k + 1)) % 3 || (n % (k + 1)) == k)
      cout << "Alice"
           << "\n";
    else
      cout << "Bob"
           << "\n";
  } else {
    if (n % 3 == 0) {
      cout << "Bob"
           << "\n";
    } else {
      cout << "Alice"
           << "\n";
    }
  }
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << fixed << setprecision(20);
  int t;
  cin >> t;
  while (t--) solve(t);
  return 0;
}
