#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e18;
const int N = 1e6 + 10;
const long long mod = 1e9 + 7;
const int base = 131;
const double pi = acos(-1);
const double eps = 1e-8;
inline long long ksm(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod, b >>= 1;
  }
  return ans;
}
unordered_map<long long, long long> mp;
long long vis[N], num[N], did[N];
long long n, m, k, x, y, z;
long long cx, cy, cz, cnt, ans, sum, flag, t, ff, q, w;
vector<int> v[N], res;
string s;
char a[N];
int sg[N];
int main() {
  int n, k;
  cin >> q;
  while (q--) {
    cin >> n >> k;
    if (k % 3 != 0) {
      if (n % 3 == 0)
        cout << "Bob" << endl;
      else
        cout << "Alice" << endl;
    } else {
      t = n / (k + 1);
      n -= t * (k + 1);
      if (n == k)
        cout << "Alice" << endl;
      else {
        if (n % 3 == 0)
          cout << "Bob" << endl;
        else
          cout << "Alice" << endl;
      }
    }
  }
}
