#include <bits/stdc++.h>
using namespace std;
const long long BUF = 1000000;
char buf[BUF], *p1, *p2;
inline char getChar() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, BUF, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline long long read() {
  long long f = 0;
  char c;
  while (!isdigit(c = getChar())) {
  }
  do f = f * 10 + (c ^ 48);
  while (isdigit(c = getChar()));
  return f;
}
const long long maxN = 100003;
signed main() {
  long long testCase, n, k;
  for (testCase = read(); testCase; --testCase) {
    n = read(), k = read();
    if (k % 3 == 0) {
      if (n % (k + 1) == k)
        printf("Alice\n");
      else
        printf(n % 3 != (n / (k + 1)) % 3 ? "Alice\n" : "Bob\n");
    } else
      printf(n % 3 ? "Alice\n" : "Bob\n");
  }
  return 0;
}
