program countturns;

var
    K, N, T, test, r, P : LongInt;
    S             : AnsiString;

begin
{
    uncomment the two following lines if you want to read/write from files
    assign(input,  'input.txt');  reset(input);
    assign(output, 'output.txt'); rewrite(output);
}

    ReadLn(T);
    for test:=1 to T do begin
        ReadLn(N, K);

        S := '';
        
        if K mod 2 =0 then
                        begin
                           P:=(K*(K+1)) div 2;
                           r:=(N-1) mod P +1;
                           if (r<=P) and (r>=P-K+1) then S:='Alice'
                                                    else S:='Bob';
                         end
                      else
                         begin
                           P:=K*(K+1);
                           r:=(N-1) mod P +1;
                           if (r<=((K*K)+1) div 2 +K-1) and (r>=((K*K)+1) div 2) or ((r<=P) and (r>=P-K+1)) then S:='Alice'
                                                                                                            else S:='Bob';
                         end;

        WriteLn(S);
    end;

end.