#include <bits/stdc++.h>
using namespace std;
int n, k;
void read(int &x) {
  x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    read(n), read(k);
    if (n == 0)
      puts("Bob");
    else if (k % 3 != 0) {
      if (n % 3 == 0)
        puts("Bob");
      else
        puts("Alice");
    } else {
      int num = (n - 1) % (k + 1) + 1;
      if ((num != k + 1 && num % 3 != 0) || num == k)
        puts("Alice");
      else
        puts("Bob");
    }
  }
  return 0;
}
