#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        {
            cout<<i<<endl;
        cou=dfs(i,si);
        cout<<cou<<" "<<si<<endl;
        if(cou==1||cou==2)
        continue;
        else if(si+1!=(cou*(cou-1))/2)
        {
            flag=1;
        cout<<"NO"<<endl;
        break;
        }
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    vector<int>a[n+3];
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    int flag=0,arr[n+3],k=0;
    for(i=1;i<=n;i++)
    {
        arr[k]=a[i].size();
        k++;
    }
    //for(i=0;i<n;i++)
    //cout<<arr[i];
    sort(arr,arr+n);
    for(i=0;i<n-1;i++)
    {
        if(arr[i]==0)
        continue;
        else
        {
            if(arr[i]!=arr[i+1])
                {flag=1;break;}
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    if(m==((n)*(n-1))/2)
    cout<<"YES"<<endl;
    else{
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        cou=dfs(i,si);
        //cout<<cou<<" "<<si<<endl;
        if(cou==1||cou==2)
        continue;
        else if(si+1!=(cou*(cou-1))/2)
        {
            flag=1;
        cout<<"NO"<<endl;
        break;
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;}
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    if(m==((n)*(n-1))/2)
    cout<<"YES"<<endl;
    else{
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        cou=dfs(i,si);
        //cout<<cou<<" "<<si<<endl;
        if(cou==1)
        continue;
        if(si+1!=(cou*(cou-1))/2)
        {
            flag=1;
        cout<<"NO"<<endl;
        break;
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;}
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
int visited[150010]={0};
vector<int>a[150003];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    if(a[i].size())
    visited[i]=1;
    for(int i1=0;i1<a[i].size();i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(1);
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
int visited[100010]={0};
vector<int>a[100003];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    if(a[i].size())
    visited[i]=1;
    for(int i1=0;i1<a[i].size();i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(1);
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[160010]={0};
vector<int>a[160010];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=1;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        {
        cou=dfs(i,si);
        if(cou>2&&(cou*(cou-1))/2!=((si+1)*si)/2)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        }
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    if(m==((n)*(n-1))/2)
    cout<<"YES"<<endl;
    else{
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        cou=dfs(i,si);
        if(si!=cou*(cou-1)/2)
        {
            flag=1;
        cout<<"NO"<<endl;
        break;
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;}
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    vector<int>a[n+3];
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    int flag=0,flag2=0;
    for(i=1;i<=n;i++)
    {
        if(a[i].size()>1)
        flag2=1;
    }
    if(flag2){
    for(i=1;i<=n;i++)
    {
        if(a[i].size()==0)
        continue;
        else
        {
            if(a[i].size()&1)
            {
                flag=1;
                break;
            }
        }

    }
    }
    if(flag==0)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
int visited[160010]={0};
vector<int>a[160010];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
        return 0;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        {
           // cout<<i<<endl;
        cou=dfs(i,si);
        //cout<<cou<<" "<<si<<endl;
        if(cou==1||cou==2)
        continue;
        else if(si+1!=(cou*(cou-1))/2)
        {
            flag=1;
        cout<<"NO"<<endl;
        break;
        }
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO";
        exit(0);
        }
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    if(m==((n)*(n-1))/2)
    cout<<"YES";
    else{
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        if(visited[i]==0)
        dfs(i,si);
    }
        cout<<"YES";}
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    for(int i1=0;i1<a[i].size();i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
       return 0;
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
     return 1;
}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    int flag=0;
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        {
        if(dfs(i,a[i].size()))
        {
            flag=1;
            cout<<"YES"<<endl;
            break;
        }
        }

    }
       if(flag==0)
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        {
           // cout<<i<<endl;
        cou=dfs(i,si);
        //cout<<cou<<" "<<si<<endl;
        if(cou==1||cou==2)
        continue;
        else if(cou!=((si+1)*si)/2)
        {
        cout<<"NO"<<endl;
        exit(1);
        }
        }
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[160010]={0};
vector<int>a[160010];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    if(m==((n)*(n-1))/2)
    cout<<"YES"<<endl;
    else{
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;}
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    for(int i1=0;i1<a[i].size();i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(1);
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long
int visited[160010]={0};
vector<int>a[160010];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(1);
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    if(m==((n)*(n-1))/2)
    cout<<"YES"<<endl;
    else{
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        {cou=dfs(i,si);
        //cout<<cou<<" "<<si<<endl;
        if(cou==1||cou==2)
        continue;
        else if(si+1!=(cou*(cou-1))/2)
        {
            flag=1;
        cout<<"NO"<<endl;
        break;
        }
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;}
}


#include <bits/stdc++.h>
using namespace std;
int visited[160010]={0};
vector<int>a[160010];
void dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        {
           // cout<<i<<endl;
        cou=dfs(i,si);
        //cout<<cou<<" "<<si<<endl;
        if(cou==1||cou==2)
        continue;
        else if(cou!=((si+1)*si)/2)
        {
            flag=1;
        cout<<"NO"<<endl;
        break;
        }
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int ct=0;
int dfs(int i,int si)
{
    //cout<<i<<" ";
    visited[i]=1;
    int siz=a[i].size();
    for(int i1=0;i1<siz;i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
        cout<<"NO"<<endl;
        exit(0);
        }
        ct++;
        dfs(a[i][i1],a[a[i][i1]].size());}
    }
return ct;
}
main()
{
    int n,m,i,x,y,cou,flag=0;
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    if(m==((n)*(n-1))/2)
    cout<<"YES"<<endl;
    else{
    for(i=1;i<=n;i++)
    {
        int si=a[i].size();
        ct=1;
        if(visited[i]==0)
        cou=dfs(i,si);
        //cout<<cou<<" "<<si<<endl;
        if(cou==1||cou==2)
        continue;
        if(si+1!=(cou*(cou-1))/2)
        {
            flag=1;
        cout<<"NO"<<endl;
        break;
        }
    }
    if(flag==0)
        cout<<"YES"<<endl;}
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
int dfs(int i,int si)
{
    visited[i]=1;
    for(int i1=0;i1<a[i].size();i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
      cout<<"NO"<<endl;
      exit(1);
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    int flag=0;
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
int visited[150010]={0};
vector<int>a[150010];
void dfs(int i,int si)
{
    visited[i]=1;
    for(int i1=0;i1<a[i].size();i1++)
    {
        if(visited[a[i][i1]]==0){
        if(a[a[i][i1]].size()!=si)
        {
      cout<<"NO"<<endl;
      return;
        }
        else
        dfs(a[i][i1],a[a[i][i1]].size());}
    }

}
main()
{
    int n,m,i,x,y;
    cin>>n>>m;
    for(i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    int flag=0;
    for(i=1;i<=n;i++)
    {
        if(visited[i]==0)
        dfs(i,a[i].size());
    }
        cout<<"YES"<<endl;
}


#include <bits/stdc++.h>

using namespace std;

vector<int> vec[100005];
bool visit[100005];

void dfs(int i, long long &Nodes, long long &Edges){
	if(visit[i]) return;
	visit[i] = true;
	Nodes++;
	Edges += vec[i].size();
	for(int x : vec[i]){
		if(!visit[x]) dfs(x,Nodes,Edges);
	}
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("in.txt","r",stdin);
		//freopen("out.txt","w",stdout);
	#endif

	int n,m,a,b;
	while(cin>>n>>m){
		for(int i=0; i<m; i++){
			cin>>a>>b;
			vec[a].push_back(b);
			vec[b].push_back(a);
		}
		memset(visit,false,sizeof(visit));
		bool flag = false;
		for(int i=1; i<=n; i++){
			if(!visit[i]){
				long long Nodes = 0, Edges = 0;
				dfs(i,Nodes,Edges);
				//cout<<"Nodes: "<<Nodes<<", Edges: "<<Edges<<endl;
				if((Nodes*(Nodes-1)) != Edges){
					flag = true;
					break;
				}
			}
		}
		if(flag) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
		for(int i=0;i<100005; i++) vec[i].clear();
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

vector<int> vec[150005];
bool visit[150005];

void dfs(int i, long long &Nodes, long long &Edges){
	if(visit[i]) return;
	visit[i] = true;
	Nodes++;
	Edges += vec[i].size();
	for(int x : vec[i]){
		if(!visit[x]) dfs(x,Nodes,Edges);
	}
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("in.txt","r",stdin);
		//freopen("out.txt","w",stdout);
	#endif

	int n,m,a,b;
	while(cin>>n>>m){
		for(int i=0; i<m; i++){
			cin>>a>>b;
			vec[a].push_back(b);
			vec[b].push_back(a);
		}
		memset(visit,false,sizeof(visit));
		bool flag = false;
		for(int i=1; i<=n; i++){
			if(!visit[i]){
				long long Nodes = 0, Edges = 0;
				dfs(i,Nodes,Edges);
				//cout<<"Nodes: "<<Nodes<<", Edges: "<<Edges<<endl;
				if((Nodes*(Nodes-1)) != Edges){
					flag = true;
					break;
				}
			}
		}
		if(flag) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
		for(int i=0;i<100005; i++) vec[i].clear();
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

vector<int> vec[100005];
bool visit[100005];

void dfs(int i, int &Nodes, int &Edges){
	if(visit[i]) return;
	visit[i] = true;
	Nodes++;
	Edges += vec[i].size();
	for(int x : vec[i]){
		if(!visit[x]) dfs(x,Nodes,Edges);
	}
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("in.txt","r",stdin);
		//freopen("out.txt","w",stdout);
	#endif

	int n,m,a,b;
	while(cin>>n>>m){
		for(int i=0; i<m; i++){
			cin>>a>>b;
			vec[a].push_back(b);
			vec[b].push_back(a);
		}
		memset(visit,false,sizeof(visit));
		bool flag = false;
		for(int i=1; i<=n; i++){
			if(!visit[i]){
				int Nodes = 0, Edges = 0;
				dfs(i,Nodes,Edges);
				//cout<<"Nodes: "<<Nodes<<", Edges: "<<Edges<<endl;
				if((long long)(Nodes*(Nodes-1)) != Edges){
					flag = true;
					break;
				}
			}
		}
		if(flag) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
		for(int i=0;i<100005; i++) vec[i].clear();
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

vector<int> vec[100005];
bool visit[100005];

void dfs(int i, int &Nodes, int &Edges){
	if(visit[i]) return;
	visit[i] = true;
	Nodes++;
	Edges += vec[i].size();
	for(int x : vec[i]){
		if(!visit[x]) dfs(x,Nodes,Edges);
	}
}

int main()
{
	#ifndef ONLINE_JUDGE
		freopen("in.txt","r",stdin);
		//freopen("out.txt","w",stdout);
	#endif

	int n,m,a,b;
	while(cin>>n>>m){
		for(int i=0; i<m; i++){
			cin>>a>>b;
			vec[a].push_back(b);
			vec[b].push_back(a);
		}
		memset(visit,false,sizeof(visit));
		bool flag = false;
		for(int i=1; i<=n; i++){
			if(!visit[i]){
				int Nodes = 0, Edges = 0;
				dfs(i,Nodes,Edges);
				//cout<<"Nodes: "<<Nodes<<", Edges: "<<Edges<<endl;
				if((Nodes*(Nodes-1)) != Edges){
					flag = true;
					break;
				}
			}
		}
		if(flag) cout<<"No"<<endl;
		else cout<<"Yes"<<endl;
		for(int i=0;i<100005; i++) vec[i].clear();
	}
	return 0;
}


#include <bits/stdc++.h>
#define M 1000000007
#define INF 999999999
#define EPS 1e-9
#define pb push_back
#define mp make_pair
#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
#define MAX 150555
#define fs first
#define sc second
using namespace std;
typedef  long long int ll;
typedef pair<ll,ll> ii;
typedef vector <ii> vii;
typedef vector <ll> vi;
vector<vi> adj(MAX);

int vis[150555]={0};
ll vertices=0,edges=0;
void dfs(ll u)
{
    if(vis[u]==1) return;
    vis[u]=1;
    vertices++;
    edges+=(ll)adj[u].size();
    for(int i=0;i<(ll)adj[u].size();i++)
    {
        int pp=adj[u][i];
        if(!vis[pp])
            dfs(pp);
    }
    return;
}

int main()
{
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
ios::sync_with_stdio(false);
 cin.tie(0);
 ll n,m,a,b;
 cin>>n>>m;
 while(m--)
 {
    cin>>a>>b;
    a--;b--;
    adj[a].pb(b);
    adj[b].pb(a);
 }

for(int i=0;i<n;i++)
{
    if(!vis[i])
    {
        edges=0;
        vertices=0;
        dfs(i);
        if(edges!=(ll)vertices*(vertices-1))
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
}
cout<<"YES"<<endl;

return 0;

}


#include <bits/stdc++.h>
#define M 1000000007
#define INF 999999999
#define EPS 1e-9
#define pb push_back
#define mp make_pair
#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
#define MAX 150005
#define fs first
#define sc second
using namespace std;
typedef  int ll;
typedef pair<ll,ll> ii;
typedef vector <ii> vii;
typedef vector <ll> vi;
vector<vi> adj(MAX);

int vis[150005]={0};
ll vertices=0,edges=0;
void dfs(int u)
{
    if(vis[u]==1) return;
    vis[u]=1;
    vertices++;
    edges+=(int)adj[u].size();
    for(int i=0;i<adj[u].size();i++)
    {
        int pp=adj[u][i];
        if(!vis[pp])
            dfs(pp);
    }
}

int main()
{
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
ios::sync_with_stdio(false);
 cin.tie(0);
 ll n,m,a,b;
 cin>>n>>m;
 while(m--)
 {
    cin>>a>>b;
    a--;b--;
    adj[a].pb(b);
    adj[b].pb(a);
 }

for(int i=0;i<n;i++)
{
    if(!vis[i])
    {
        edges=0;
        vertices=0;
        dfs(i);
        if(edges!=(ll)vertices*(vertices-1))
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
}
cout<<"YES"<<endl;

return 0;

}


#include <bits/stdc++.h>
#define M 1000000007
#define INF 999999999
#define EPS 1e-9
#define pb push_back
#define mp make_pair
#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
#define MAX 150005
#define fs first
#define sc second
using namespace std;
typedef  int ll;
typedef pair<ll,ll> ii;
typedef vector <ii> vii;
typedef vector <ll> vi;
vector<vi> adj(MAX);

int vis[150005]={0};
ll vertices=0,edges=0;
void dfs(int u)
{
    if(vis[u]==1) return;
    vis[u]=1;
    vertices++;
    edges+=(int)adj[u].size();
    for(int i=0;i<adj[u].size();i++)
    {
        int pp=adj[u][i];
        if(!vis[pp])
            dfs(pp);
    }
}

int main()
{
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
ios::sync_with_stdio(false);
 cin.tie(0);
 ll n,m,a,b;
 cin>>n>>m;
 while(m--)
 {
    cin>>a>>b;
    a--;b--;
    adj[a].pb(b);
    adj[b].pb(a);
 }

for(int i=0;i<n;i++)
{
    if(!vis[i])
    {
        edges=0;
        vertices=0;
        dfs(i);
        if(edges!=vertices*(vertices-1))
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
}
cout<<"YES"<<endl;

return 0;

}


#include <bits/stdc++.h>
#define M 1000000007
#define INF 999999999
#define EPS 1e-9
#define pb push_back
#define mp make_pair
#define SET(a) memset(a,-1,sizeof(a))
#define CLR(a) memset(a,0,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
#define MAX 150555
#define fs first
#define sc second
using namespace std;
typedef  int ll;
typedef pair<ll,ll> ii;
typedef vector <ii> vii;
typedef vector <ll> vi;
vector<vi> adj(MAX);

int vis[150555]={0};
ll vertices=0,edges=0;
void dfs(ll u)
{
    if(vis[u]==1) return;
    vis[u]=1;
    vertices++;
    edges+=(ll)adj[u].size();
    for(int i=0;i<(ll)adj[u].size();i++)
    {
        int pp=adj[u][i];
        if(!vis[pp])
            dfs(pp);
    }
    return;
}

int main()
{
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
ios::sync_with_stdio(false);
 cin.tie(0);
 ll n,m,a,b;
 cin>>n>>m;
 while(m--)
 {
    cin>>a>>b;
    a--;b--;
    adj[a].pb(b);
    adj[b].pb(a);
 }

for(int i=0;i<n;i++)
{
    if(!vis[i])
    {
        edges=0;
        vertices=0;
        dfs(i);
        if(edges!=(ll)vertices*(vertices-1))
        {
            cout<<"NO"<<endl;
            return 0;
        }
    }
}
cout<<"YES"<<endl;

return 0;

}


#include<bits/stdc++.h>
using namespace std;

int n , m, a, b;
const int lim = 150001;
vector<int> f[lim];

int v[lim];
int ccc;
int e;
int dfs( int r){
    v[r] = 1;
    ccc++;
    for( auto j : f[r] ){
        e++;
        if( v[j] == 0 ) dfs( j );
    }
}

int nc2(int a){
    return a*(a-1)/2;
}

int netm;
int main(){
    scanf( "%d" , &n );
    scanf( "%d" , &m );
    for( int i = 0; i<m; i++ ){
        scanf( "%d" , &a );
        scanf( "%d" , &b );
        f[a].push_back(b);
        f[b].push_back(a);
    }
    int flag = 0;
    for( int i = 1 ; i <=n ; i++ )
    {
        ccc = 0;
        e=0;
        if( v[i] == 0)
        {
            dfs( i );
            cout << i << " " << ccc <<" "<< e/2 << endl;
            if( e/2 != nc2(ccc) )
            {
                flag = 1;
                cout << "NO";
                break;
            }
        }
    }
    if( flag == 0 ) cout << "YES";
}


#include<bits/stdc++.h>
using namespace std;

int n , m, a, b;
const int lim = 150001;
vector<int> f[lim];

int v[lim];
int ccc;
int e;
int dfs( int r){
    v[r] = 1;
    ccc++;
    for( auto j : f[r] ){
        e++;
        if( v[j] == 0 ) dfs( j );
    }
}

long long nc2(long long a){
    return a*(a-1)/2;
}

int netm;
int main(){
    scanf( "%d" , &n );
    scanf( "%d" , &m );
    for( int i = 0; i<m; i++ ){
        scanf( "%d" , &a );
        scanf( "%d" , &b );
        f[a].push_back(b);
        f[b].push_back(a);
    }
    int flag = 0;
    for( int i = 1 ; i <=n ; i++ )
    {
        ccc = 0;
        e=0;
        if( v[i] == 0)
        {
            dfs( i );
            /* cout << i << " " << ccc <<" "<< e/2 << endl; */
            if( e/2 != nc2(ccc) )
            {
                flag = 1;
                cout << "NO";
                break;
            }
        }
    }
    if( flag == 0 ) cout << "YES";
}


#include<bits/stdc++.h>
using namespace std;

int n , m, a, b;
const int lim = 150001;
vector<int> f[lim];

int v[lim];
int ccc;
int e;
int dfs( int r){
    v[r] = 1;
    ccc++;
    for( auto j : f[r] ){
        e++;
        if( v[j] == 0 ) dfs( j );
    }
}

int nc2(int a){
    return a*(a-1)/2;
}

int netm;
int main(){
    scanf( "%d" , &n );
    scanf( "%d" , &m );
    for( int i = 0; i<m; i++ ){
        scanf( "%d" , &a );
        scanf( "%d" , &b );
        f[a].push_back(b);
        f[b].push_back(a);
    }
    int flag = 0;
    for( int i = 1 ; i <=n ; i++ )
    {
        ccc = 0;
        e=0;
        if( v[i] == 0)
        {
            dfs( i );
            /* cout << i << " " << ccc <<" "<< e/2 << endl; */
            if( e/2 != nc2(ccc) )
            {
                flag = 1;
                cout << "NO";
                break;
            }
        }
    }
    if( flag == 0 ) cout << "YES";
}


#include<bits/stdc++.h>
using namespace std;

int n , m, a, b;
const int lim = 150001;
vector<int> f[lim];

int v[lim];
int ccc;
int dfs( int r){
    v[r] = 1;
    ccc++;
    for( auto j : f[r] ){
        if( v[j] == 0 ) dfs( j );
    }
}

int nc2(int a){
    return a*(a-1)/2;
}

int netm;
int main(){
    scanf( "%d" , &n );
    scanf( "%d" , &m );
    for( int i = 0; i<m; i++ ){
        scanf( "%d" , &a );
        scanf( "%d" , &b );
        f[a].push_back(b);
        f[b].push_back(a);
    }
    for( int i = 1 ; i <=n ; i++ )
    {
        ccc = 0;
        if( v[i] == 0)
        {
            dfs( i );
            /* cout << i << " " << ccc << endl; */
            netm += nc2(ccc);
        }
    }
    /* cout << netm; */
    if( netm == m){
        cout << "YES";
    }
    else
        cout << "NO";
}


import java.util.*;
import java.io.*;
public class Main {
    static class Scan {
        private byte[] buf=new byte[1024];
        private int index;
        private InputStream in;
        private int total;
        public Scan()
        {
            in=System.in;
        }
        public int scan()throws IOException
        {
            if(total<0)
            throw new InputMismatchException();
            if(index>=total)
            {
                index=0;
                total=in.read(buf);
                if(total<=0)
                return -1;
            }
            return buf[index++];
        }
        public int scanInt()throws IOException
        {
            int integer=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    integer*=10;
                    integer+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            return neg*integer;
        }
        public double scanDouble()throws IOException
        {
            double doub=0;
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            int neg=1;
            if(n=='-')
            {
                neg=-1;
                n=scan();
            }
            while(!isWhiteSpace(n)&&n!='.')
            {
                if(n>='0'&&n<='9')
                {
                    doub*=10;
                    doub+=n-'0';
                    n=scan();
                }
                else throw new InputMismatchException();
            }
            if(n=='.')
            {
                n=scan();
                double temp=1;
                while(!isWhiteSpace(n))
                {
                    if(n>='0'&&n<='9')
                    {
                        temp/=10;
                        doub+=(n-'0')*temp;
                        n=scan();
                    }
                    else throw new InputMismatchException();
                }
            }
            return doub*neg;
        }
        public String scanString()throws IOException
        {
            StringBuilder sb=new StringBuilder();
            int n=scan();
            while(isWhiteSpace(n))
            n=scan();
            while(!isWhiteSpace(n))
            {
                sb.append((char)n);
                n=scan();
            }
            return sb.toString();
        }
        private boolean isWhiteSpace(int n)
        {
            if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
            return true;
            return false;
        }
    }

    public static void sort(int arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(int arr[],int l1,int r1,int l2,int r2) {
        int tmp[]=new int[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }

    public static void sort(long arr[],int l,int r) {    //sort(arr,0,n-1);
        if(l==r) {
            return;
        }
        int mid=(l+r)/2;
        sort(arr,l,mid);
        sort(arr,mid+1,r);
        merge(arr,l,mid,mid+1,r);
    }
    public static void merge(long arr[],int l1,int r1,int l2,int r2) {
        long tmp[]=new long[r2-l1+1];
        int indx1=l1,indx2=l2;
        //sorting the two halves using a tmp array
        for(int i=0;i<tmp.length;i++) {
            if(indx1>r1) {
                tmp[i]=arr[indx2];
                indx2++;
                continue;
            }
            if(indx2>r2) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            if(arr[indx1]<arr[indx2]) {
                tmp[i]=arr[indx1];
                indx1++;
                continue;
            }
            tmp[i]=arr[indx2];
            indx2++;
        }
        //Copying the elements of tmp into the main array
        for(int i=0,j=l1;i<tmp.length;i++,j++) {
            arr[j]=tmp[i];
        }
    }

    public static void main(String args[]) throws IOException {
        Scan input=new Scan();
        StringBuilder ans=new StringBuilder("");
        int n=input.scanInt();
        int arr[]=new int[n];
        int indx=0;
//        ArrayList<Integer> arrli[]=new ArrayList[2*n];
//        for(int i=0;i<arrli.length;i++) {
//            arrli[i]=new ArrayList<>();
//        }
        int chr[]=new int[2*n];
        for(int i=0;i<2*n;i++) {
            char tmp=input.scanString().charAt(0);
            if(tmp=='+') {
                chr[i]=-1;
                indx++;
            }
            else {
                chr[i]=input.scanInt();
//                arrli[indx].add(chr[i]);
            }
        }
        TreeSet<Integer> ts=new TreeSet<>();
        indx=n-1;
        for(int i=chr.length-1;i>=0;i--) {
            if(chr[i]==-1) {
                if(ts.isEmpty()) {
                    System.out.println("NO");
                    return;
                }
                arr[indx]=ts.first();
                ts.remove(arr[indx]);
                indx--;
            }
            else {
                ts.add(chr[i]);
            }
        }
        if(!check(n,arr,chr)) {
            ans.append("NO\n");
        }
        else {
            ans.append("YES\n");
            for(int i=0;i<n;i++) {
                ans.append(arr[i]+" ");
            }
            ans.append("\n");
        }
        System.out.println(ans);
    }
    public static boolean check(int n,int arr[],int chr[]) {
        int indx=0;
        TreeSet<Integer> ts=new TreeSet<>();
        for(int i=0;i<chr.length;i++) {
            if(chr[i]==-1) {
                ts.add(arr[indx]);
                indx++;
            }
            else {
                if(ts.isEmpty()) {
                    return false;
                }
                int tmp=ts.first();
                if(tmp!=chr[i]) {
                    return false;
                }
                ts.remove(tmp);
            }
        }
        return true;
    }
}


#include<bits/stdc++.h>
using namespace std;

int t, n, x;

int main()
{
	scanf("%d", &t);
	for(int i = 1; i <= t; ++ i)
	{
		scanf("%d%d", &n, &x);
		if(x % 3 != 0)
		{
			if(n % 3 == 0)
				printf("Bob\n");
			else
				printf("Alice\n");
		}
		else
		{
			n %= (x + 1);
			if(n % 3 == 0 && n != x)
				printf("Bob\n");
			else
				printf("Alice\n");
		}
	}
	return 0;
}


# include <bits/stdc++.h>
# define rr register
const int N=100010,INF=0x3f3f3f3f;
int T;
int n,k;
inline int read(void){
	int res,f=1;
	char c;
	while((c=getchar())<'0'||c>'9')
		if(c=='-')f=-1;
	res=c-48;
	while((c=getchar())>='0'&&c<='9')
		res=res*10+c-48;
	return res*f;
}
int main(void){
	T=read();
	while(T--){
		n=read(),k=read();
		if(k%3){
			if(n%3==0){
				puts("Bob");
			}else{
				puts("Alice");
			}
		}else{
			n%=(k+1);
			if(n%3==0&&n!=k){
				puts("Bob");
			}else{
				puts("Alice");
			}
		}
	}

	return 0;
}


#define de puts("#")
#define bug(x) cout<<#x<<" : "<<x<<endl
#define cha1 printf("L : %d,R : %d,x : %d,l : %d,r : %d,rt : %d\n",L,R,x,l,r,rt)
#define cha2 printf("L : %d,R : %d,l : %d,r : %d,rt : %d\n",L,R,l,r,rt)
#define lcha1 printf("L : %lld,R : %lld,x : %lld,l : %lld,r : %lld,rt : %lld\n",L,R,x,l,r,rt)
#define lcha2 printf("L : %lld,R : %lld,l : %lld,r : %lld,rt : %lld\n",L,R,l,r,rt)
#define huge(n,m,a) for(int i=1; i<=n; i++) {for(int j=1; j<=m; j++)printf("%d ",a[i][j]);puts("");}puts("")
#define lhuge(n,m,a) for(int i=1; i<=n; i++) {for(int j=1; j<=m; j++)printf("%lld ",a[i][j]);puts("");}puts("")
#define lowbit(x) (x&(-x))
#include<iostream>
#include<stdio.h>
#include<string.h>
using namespace std;

//int main() {
//	int vis[20];
//	for(int i = 3 ; i < 20 ; i++) {
//		cout<<"i: "<<i<<endl;
//		memset(vis,0,sizeof(vis));
//		for(int j = 1; j < 20 ;j++) {
//			if((j-1>=0 && !vis[j-1]) || (j-2>=0 && !vis[j-2]) ||(j-i>=0&& !vis[j-i])){
//				vis[j] = 1;
//			}
//			cout<<vis[j]<<' ';
//		}
//		cout<<endl;
//	}
//}

int main() {
	int q,n,k;
	scanf("%d",&q);
	while(q--) {
		scanf("%d %d",&n,&k);
		bool flag=1;
		if(k%3==0) {//k是3的倍数，循环节为k+1；
			n%=(k+1);
			if(n%3)flag=0;
			if(n==k)flag=0;
		} else {
			if(n%3)flag=0;//k不是3的倍数，循环节为3；
		}
		puts(flag?"Bob":"Alice");
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
  int t,k,n,i;
  cin>>t;
  for(i=1;i<=t;++i){
  	cin>>n>>k;
  	if(k%3==0){
  		if(n%3==0)cout<<"Alice"<<endl;
  		else cout<<"Bob"<<endl;
		}
		else cout<<"Bob"<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
for(int i=1;i<=t;i++){
    int n,x;
    cin>>n>>x;
    if(x%3!=0){
        if(n%3==0) cout<<"Bob"<<endl;
        else cout<<"Alice"<<endl;
    }
    else{
        n%=(x+1);
        if(n%3==0&&n!=x) cout<<"Bob"<<endl;
        else cout<<"Alice"<<endl;
    }
}
return 0;
}


#include<cstdio>
using namespace std;
typedef long long ll;
#define re register ll
ll n,k;
inline void rea(re&dd)
{
	dd=0;re ch=getchar();
	while(ch<48||ch>57)ch=getchar();
	while(ch>=48&&ch<=57)dd=(dd<<3)+(dd<<1)+(ch^48),ch=getchar();
}
int main()
{
	re T;
	rea(T);
	while(T--)
	{
		rea(n),rea(k);
		if(!n){printf("Bob\n");continue;}
		if(n==1||n==2||n==k){printf("Alice\n");continue;}
		if(n<k||k%3)
		{
			if(n%3)printf("Alice\n");
			else printf("Bob\n");
			continue;
		}
		re now=(n/k)&1,tmp=n%k%3;
		if((!now&&tmp)||(now&&!tmp))printf("Alice\n");
		else printf("Bob\n");
	}
 	return 0;
}


#include<cstdio>
#include<cstdlib>
const int MAXN=105;
int n,k;
bool a[MAXN];
int main(){
	int t;
	scanf("%d",&t);
	while(t--){
		scanf("%d%d",&n,&k);
		if(k%3){
			if(n%3) puts("Alice");
			else puts("Bob");
		}
		else{
			int x=n%(k+1);
			if(!x) puts("Bob");
			else if(x==k) puts("Alice");
			else if(x%3) puts("Alice");
			else puts("Bob");
		}
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define N 1000005
using std::sort;
bool vis[N];
int f[N],sg[N],m,n;
inline void read(int &x)
{
	x = 0;char ch = getc(stdin);
	while(ch > '9' || ch < '0') ch = getc(stdin);
	while(ch <= '9'&&ch >= '0') {x = x * 10 + (ch ^ 48);ch = getc(stdin);}
}

void I_Play_For_SG()
{
	sort(f + 1,f + 3 + 1);
	sg[0] = 0;
	register int i,j;
	for(i = 1;i <= n;++ i)
	{
		memset(vis,0,sizeof vis);
		for(j = 1;j <= 3&&f[j] <= i;++ j)
			vis[sg[i - f[j]]] = true;
		for(j = 0;j <= n;++ j)
			if(!vis[j])
			{
				sg[i] = j;
				break;
			 }
		printf("%d:%d\n",i,sg[i]);
	}
}

int main()
{
	register int i;
/*	for(i = 1;i <= 20;++ i)
	{
		f[1] = 1,f[2] = 2,f[3] = i;
		printf("%d:\n",i);
		I_Play_For_SG();
	}*/
	int t,n,k,a,p;
	read(t);
	while(t --)
	{
		read(n),read(k);
		int ans = 0;
		if(k % 3) ans = n % 3;
		else if(k == n) ans = 1;
		else ans = (n % (k + 1)) % 3||(n % (k + 1)) == 3;
		if(ans) puts("Alice");
		else puts("Bob");
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int main() {
	int T; scanf("%d",&T);
	while (T--) {
		int n,k; scanf("%d%d",&n,&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 (1<=num && num<=k-1) {
				if (num%3==0) puts("Bob");
				else puts("Alice");
			} else if (num==k)
				puts("Alice");
			else puts("Bob");
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,k,n1;
void work()
{
	scanf("%d%d",&n,&k);
	if(k%3)
		if(n%3)puts("Alice");
		else puts("Bob");
	else
		if((n%(k+1)==k)||((n%(k+1))%3))puts("Alice");
		else puts("Bob");
	return;
}
int main()
{
	scanf("%d",&n1);
	while(n1--)work();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
void check(int n,int k)
{
	if(k%3){
		if(n%3) cout<<"Alice"<<endl;
		else cout<<"Bob"<<endl;
	}
	else{
		if(n<k)
		{
			if(n%3) cout<<"Alice"<<endl;
			else cout<<"Bob"<<endl;
		}
		else{
			n%=k+1;
			if(n%3||n==k)
				cout<<"Alice"<<endl;
				else cout<<"Bob"<<endl;
		}
	}
}
int main()
{
	int t,n,k;
	cin>>t;
	for(int i=1;i<=t;i++)
	{
		cin>>n>>k;
		check(n,k);
	}
	return 0;
}


#include <iostream>
using namespace std;
int t;
int main(){
    cin>>t;
    while(t--){
        int n,m;
        cin>>n>>m;
        n%=(m+1);
        if(n==m||n%3) puts("Alice");
        else puts("Bob");
    }
}


#include<cstdio>
int t,n,k;
int main(){
    scanf("%d",&t);
    while(t--){
        scanf("%d%d",&n,&k);
        if(x%3!=0){
            if(n%3==0)
                printf("Bob\n");
            else
                printf("Alice\n");
        }
        else{
            n%=(k+1);
            if(n%3==0&&n!=k)
                printf("Bob\n");
            else
                printf("Alice\n");
        }
    }
}


#include <iostream>

int main () {
    return 0;
}


#include<cstdio>
int T,n,k;
int main()
{
	scanf("%d",&T);
	while(T--)
	{
		scanf("%d%d",&n,&k);
		if(k%3)
		{
			if(n%3)puts("Alice");
			else puts("Bob");
		}
		else if(n%(k+1)==k||n%(k+1)%3)puts("Alice");
		else puts("Bob");
	}
	return 0;
}


#include<cstdio>
#include<cstring>
#include<algorithm>
#define N 1000005
using std::sort;
bool vis[N];
int f[N],sg[N],m,n;
inline void read(int &x)
{
	x = 0;char ch = getc(stdin);
	while(ch > '9' || ch < '0') ch = getc(stdin);
	while(ch <= '9'&&ch >= '0') {x = x * 10 + (ch ^ 48);ch = getc(stdin);}
}

void I_Play_For_SG()
{
	sort(f + 1,f + 3 + 1);
	sg[0] = 0;
	register int i,j;
	for(i = 1;i <= n;++ i)
	{
		memset(vis,0,sizeof vis);
		for(j = 1;j <= 3&&f[j] <= i;++ j)
			vis[sg[i - f[j]]] = true;
		for(j = 0;j <= n;++ j)
			if(!vis[j])
			{
				sg[i] = j;
				break;
			 }
		printf("%d:%d\n",i,sg[i]);
	}
}

int main()
{
	register int i;
	int t,n,k,a,p;
	read(t);
	while(t --)
	{
		read(n),read(k);
		int ans = 0;
		if(k % 3||n < k) ans = n % 3;
		else ans = (n - 1) % k;
		if(ans) puts("Alice");
		else puts("Bob");
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<queue>
#include<cstring>
#include<algorithm>
#define lson x<<1
#define rson x<<1|1
#define ll long long
#define rint register int
#define mid  ((L + R) >> 1)
using namespace std;
template <typename xxx> inline void read(xxx &x) {
	char c = getchar(),f = 1;x = 0;
	for(;c ^ '-' && !isdigit(c);c = getchar());
	if(c == '-') c = getchar(),f = -1;
	for(;isdigit(c);c = getchar()) x = (x<<1) + (x<<3) + (c ^ '0');
	x *= f;
}
template<typename xxx>void print(xxx x)
{
    if(x<0){putchar('-');x=-x;}
    if(x>9) print(x/10);
    putchar(x%10+'0');
}
const int maxn = 100010;
const int inf = 0x7fffffff;
const int mod = 1e9 + 7;
int SG[maxn];
int vis[maxn];
int n,k;
int main()
{
	int t;read(t);
	while(t--) {
		read(n);read(k);
		if(k%3) {
			if(n%3) printf("Alice\n");
			else printf("Bob\n");
		}
		else {
			if(n % (k + 1) || n == k) printf("Alice\n");
			else printf("Bob\n");
		}
	}
	return 0;
}
/*
0 3
0

1 3
0 1

2 3
0 1 2

3 3
0 1 2 3

4 3
0 1 2 3 0

5 3
*/


#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#include<iostream>

#define ll long long
#define INF 0x3f3f3f3f
#define LLINF 0x3f3f3f3f3f3f3f3f
#define ls (rt<<1)
#define rs (rt<<1|1)
#define tmid (t[rt].l+t[rt].r>>1)
#define mid (l+r>>1)
#define mod			//
#define N			//

using namespace std;
int T, k, n;
int main(){
	scanf("%d", &T);
	while(T--){
		scanf("%d%d", &n, &k);
		if(n == k) printf("Alice\n");
		else if((n - (n % 3)) / k & 1) printf("Bob\n");
		else if(n % 3 == 0) printf("Bob\n");
		else printf("Alice\n");
	}
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
#define mem(a, x) memset(a, x, sizeof a)
//#define int long long

using namespace std;
typedef long long ll;

inline int read() {
    int s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {if (ch == '-') w = -1; ch = getchar();}
    while (ch >= '0' && ch <= '9') s = s*10+ch-'0', ch = getchar();
    return s*w;
}

int main() {
    int T = read();
    while (T--) {
        int n = read(), k = read();
        if (k%3 != 0) (n%3 == 0) ? puts("Bob") : puts("Alice");
        else ((n%(k+1))%3 == 0 && (n%(k+1)) == k) ? puts("Bob") : puts("Alice");
    }
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
#define mem(a, x) memset(a, x, sizeof a)
//#define int long long

using namespace std;
typedef long long ll;

inline int read() {
    int s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {if (ch == '-') w = -1; ch = getchar();}
    while (ch >= '0' && ch <= '9') s = s*10+ch-'0', ch = getchar();
    return s*w;
}

int main() {
    int T = read();
    while (T--) {
        int n = read(), k = read();
        if ((n%(k+1))%3 == 0 && n == k) puts("Alice");
        else if (k%3 != 0) (n%3 == 0) ? puts("Bob") : puts("Alice");
        else ((n%(k+1))%3 == 0) ? puts("Bob") : puts("Alice");
    }
    return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
#define mem(a, x) memset(a, x, sizeof a)
//#define int long long

using namespace std;
typedef long long ll;

inline int read() {
    int s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {if (ch == '-') w = -1; ch = getchar();}
    while (ch >= '0' && ch <= '9') s = s*10+ch-'0', ch = getchar();
    return s*w;
}

int main() {
    int T = read();
    while (T--) {
        int n = read(), k = read();
        if (n%3 == 0 && n == k) puts("Alice");
        else if (k%3 != 0) (n%3 == 0) ? puts("Bob") : puts("Alice");
        else ((n%(k+1))%3 == 0) ? puts("Bob") : puts("Alice");
    }
    return 0;
}


/*
 * socode.online
 *
 * Author: shajingxiang
 * E-mail: 3385764576@qq.com
 * Time  : 2020-03-25 20:47:08
 */
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<cmath>
#include<iostream>

#define ll long long
#define INF 0x3f3f3f3f
#define LLINF 0x3f3f3f3f3f3f3f3f
#define ls (rt<<1)
#define rs (rt<<1|1)
#define tmid (t[rt].l+t[rt].r>>1)
#define mid (l+r>>1)
#define mod			//
#define N			//

using namespace std;
int T, k, n;
int main(){
	scanf("%d", &T);
	while(T--){
		scanf("%d%d", &n, &k);
		if(n == k) printf("Alice\n");
		else if(n % 3 == 0) printf("Bob\n");
		else printf("Alice\n");
	}
	return 0;
}


#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define per(i, a, b) for (int i = a; i >= b; i--)
#define mem(a, x) memset(a, x, sizeof a)
//#define int long long

using namespace std;
typedef long long ll;

inline int read() {
    int s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {if (ch == '-') w = -1; ch = getchar();}
    while (ch >= '0' && ch <= '9') s = s*10+ch-'0', ch = getchar();
    return s*w;
}

int main() {
    int T = read();
    while (T--) {
        int n = read(), k = read();
        if (k%3 != 0) (n%3 == 0) ? puts("Bob") : puts("Alice");
        else ((n%(k+1))%3 == 0 && (n%(k+1)) != k) ? puts("Bob") : puts("Alice");
    }
    return 0;
}


#include <bits\stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	int n,k;
	int T;
	cin >> T;
	while(T--){
		cin >> n >> k;
		if(k%3 != 0){
			if(n%3 == 0){
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}else{
			if((n%(k+1))%3 == 0){
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}
	}
	return 0;
}


#include <bits\stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	int n,k;
	int T;
	cin >> T;
	while(T--){
		cin >> n >> k;
		if(k%3 != 0){
			if(n%3 == 0){
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}else{
			if(n%k == 0){
				cout << "Alice" << endl;
				continue;
			}
			if((n%(k+1))%3 == 0){
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}
	}
	return 0;
}


#include <bits\stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	int n,k;
	int T;
	cin >> T;
	while(T--){
		cin >> n >> k;
		if(k%3 != 0){
			if(n%3 == 0){
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}else{
			if(n%k == 0){

				cout << "Alice" << endl;
				break;
			}
			if((n%(k+1))%3 == 0){
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}
	}
	return 0;
}


#include <bits\stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	int n,k;
	int T;
	cin >> T;
	while(T--){
		cin >> n >> k;
		if(k%3 != 0){
			if(n%3 == 0){
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}else{
			if(n%k == 0 and n != 0){
				cout << "Alice" << endl;
				continue;
			}
			if((n%(k+1))%3 == 0){
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}
	}
	return 0;
}


#include <bits\stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	int n,k;
	int T;
	cin >> T;
	while(T--){
		cin >> n >> k;
//		cout << n << " ";
		if(k%3 != 0){
			if(n%3 == 0){
//		cout << n << " ";
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}else{
//			if(n%k == 0 and n != 0){
//				cout << "Alice" << endl;
//			}
			if(((n%(k+1))%3 == 0 and (n%(k+1))%k != 0 )or n%(k+1) == 0){

//		cout << n << " ";
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}
//		n++;

	}
	return 0;
}


#include <bits\stdc++.h>
using namespace std;
typedef long long ll;

int main(){
	ios::sync_with_stdio(false);
	int n,k;
	int T;
	cin >> T;
	cin >> n >> k;
	while(T--){
//		cout << n << " ";
		if(k%3 != 0){
			if(n%3 == 0){
		cout << n << " ";
				cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}else{
//			if(n%k == 0 and n != 0){
//				cout << "Alice" << endl;
//			}
			if(((n%(k+1))%3 == 0 and (n%(k+1))%k != 0 )or n%(k+1) == 0){

		cout << n << " ";	cout << "Bob" << endl;
			}else{
				cout << "Alice" << endl;
			}
		}
		n++;

	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k; bool sol[10000005]; int i,teste;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        if (sol[n]==1)
        {
            cout<<"Alice";
        }
        else

        {
            cout<<"Bob";
        }
        cout<<'\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k;int sol[1000005]; long long i,teste,nr,numar,pas;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (n<k)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {

        if (k%3!=0)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
            nr=k/3;
            numar=(nr-1)*3;
            numar+=4;
            pas=1;
            while (numar<n)
            {
                if (pas%nr==0)
                {
                    numar+=4;
                }
                else
                {
                    numar+=3;
                }
                pas++;
            }
            if (numar==n)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        }
       /* sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        for (i=0;i<=n;i++)
        {
            if (sol[i]==0)
            {
                cout<<i<<" ";
            }
        }*/
        cout<<'\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k;int sol[1000005]; long long i,teste,nr,numar,pas;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (n<k)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {

        if (k%3!=0)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
            nr=k/3;
            numar=(nr-1)*3;
            pas=4+numar;
            n=n-numar;
            n=n/pas;
            n=n-4;
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        }
       /* sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        for (i=0;i<=n;i++)
        {
            if (sol[i]==0)
            {
                cout<<i<<" ";
            }
        }*/
        cout<<'\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k;int sol[1000005]; long long i,teste,nr,numar,pas,sum;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (n<k)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
           nr=n%(k+1);
           if (nr%3!=0||nr==k)
           {
               cout<<"Alice";
           }
           else
           {
               cout<<"Bob";
           }
        }
       /* sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        for (i=0;i<=n;i++)
        {
            if (sol[i]==0)
            {
                cout<<i<<" ";
            }
        }*/
        cout<<'\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k;int sol[1000005]; long long i,teste,nr,numar,pas,sum;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (n<k)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {

        if (k%3!=0)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
            nr=k/3;
            numar=(nr-1)*3;
            pas=4+numar;
            n=n-numar;
            n=n%pas;
            sum=0;
            int pas1=1;
            while (sum<n)
            {
                if (pas1==1)
                {
                    sum+=4;
                }
                else
                {
                    sum+=3;
                }
                pas1++;
            }
            if (sum==n)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        }
       /* sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        for (i=0;i<=n;i++)
        {
            if (sol[i]==0)
            {
                cout<<i<<" ";
            }
        }*/
        cout<<'\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k; bool sol[1000000005]; int i,teste;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        if (sol[n]==1)
        {
            cout<<"Alice";
        }
        else

        {
            cout<<"Bob";
        }
        cout<<'\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k;int sol[1000005]; long long i,teste,nr,numar,pas;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (n<k)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {

        if (k%3!=0)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
            nr=k/3;
            numar=(nr-1)*3;
            pas=4+numar;
            n=n-numar;
            n=n%pas;
            if (n==0)
            {
                cout<<"Bob";
                continue;
            }
            n=n-4;
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        }
       /* sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        for (i=0;i<=n;i++)
        {
            if (sol[i]==0)
            {
                cout<<i<<" ";
            }
        }*/
        cout<<'\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k;int sol[1000005]; long long i,teste,nr,numar,pas;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (n<k)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {

        if (k%3!=0)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
            nr=k/3;
            numar=(nr-1)*3;
            pas=4+numar;
            n=n-numar;
            n=n%pas;
            n=n-4;
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        }
       /* sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        for (i=0;i<=n;i++)
        {
            if (sol[i]==0)
            {
                cout<<i<<" ";
            }
        }*/
        cout<<'\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k; bool sol[1000000005]; int i,teste;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (n<k)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
            if (k%3==0)
            {
                if (n%3==1)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
            }
            else
            if (k%3==1)
            {
                if (n%3==2)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
            }
            else
            {
                if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
            }
        }
        cout<<'\n';
        /*sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        if (sol[n]==1)
        {
            cout<<"Alice";
        }
        else

        {
            cout<<"Bob";
        }
        cout<<'\n';*/
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k; bool sol[10005]; int i,teste;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (n<k)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
            if (k%3==0)
            {
                if (n%3==1)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
            }
            else
            if (k%3==1)
            {
                if (n%3==2)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
            }
            else
            {
                if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
            }
        }
        cout<<'\n';
        /*sol[0]=0;
        sol[1]=1;
        sol[2]=1;
        for (i=3;i<=n;i++)
        {
            if (sol[i-1]==0||sol[i-2]==0)
            {
                sol[i]=1;
            }
            else
            {
                if (i-k>=0)
                {
                    if (sol[i-k]==0)
                    {
                        sol[i]=1;
                    }
                    else

                    {
                        sol[i]=0;
                    }
                }
                else
                {
                     sol[i]=0;
                }
            }
        }
        if (sol[n]==1)
        {
            cout<<"Alice";
        }
        else

        {
            cout<<"Bob";
        }
        cout<<'\n';*/
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
int t,n,k;int sol[1000005]; long long i,teste,nr,numar,pas,sum;
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>t;
    for (teste=1;teste<=t;teste++)
    {
        cin>>n>>k;
        if (k%3!=0)
        {
            if (n%3==0)
            {
                cout<<"Bob";
            }
            else
            {
                cout<<"Alice";
            }
        }
        else
        {
           nr=n%(k+1);
           if (nr%3!=0||nr==k)
           {
               cout<<"Alice";
           }
           else
           {
               cout<<"Bob";
           }
        }
        cout<<'\n';
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,k,i,t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d %d",&n,&k);

	if(k>n){
		if(n%3==0) printf("Bob\n");
		else printf("Alice\n");
	}
	else{
		if(k%3==0){
			i=n%(k+1);
			if(i%k==0) printf("Alice\n");
			else
				if(i%3==0) printf("Bob\n");
				else printf("Alice\n");
		}
		else
			if(n%3==0) printf("Bob\n");
			else printf("Alice\n");
	}
	}

return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
int t,n,k,x,y,z;
scanf("%d",&t);
while(t--){
scanf("%d %d",&n,&k);

if(k==1)
{
if(n&1)
printf("Alice");
else
printf("Bob");
}

else
{
if(n%k==0 && n/k>1 || n<k)
printf("Bob");
else
printf("Alice");
}
printf("\n");
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,k,i,t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d %d",&n,&k);

	if(k>n){
		if(n%3==0) printf("Bob\n");
		else printf("Alice\n");
	}
	else{
		if(k%3==0){
			i=n%(k+1);
			if(i%k==0) printf("Bob\n");
			else if(i==k) printf("Alice\n");
				else
					if(i%3==0) printf("Bob\n");
					else printf("Alice\n");
		}
		else
			if(n%3==0) printf("Bob\n");
			else printf("Alice\n");
	}
	}

return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
int t,n,k,x,y,z;
scanf("%d",&t);
while(t--){
scanf("%d %d",&n,&k);

if(k==1)
{
if(n&1)
printf("Alice);
else
printf("Bob");
}

else
{
if(n%k==0 && n/k>1 || n<k)
printf("Bob");
else
printf("Alice");
}
printf("\n");
}
return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,k,i,t;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d %d",&n,&k);

	if(k>n){
		if(n%3==0) printf("Bob\n");
		else printf("Alice\n");
	}
	else{
		if(k%3==0){
			i=n%(k+1);
			if(i==k) printf("Alice\n");
			else if(i%k==0) printf("Bob\n");
				else
					if(i%3==0) printf("Bob\n");
					else printf("Alice\n");
		}
		else
			if(n%3==0) printf("Bob\n");
			else printf("Alice\n");
	}
	}

return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vs;

vs w = {"Bob", "Alice", "Alice"};

string solve(int n, int k){
    if (n == k+1){
        return "Alice";
    } else if (n <= k) {
        return w[n%3];
    }

    return solve(n-k, k);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);

    int t;
    cin >> t;
    for (int T = 0; T < t; T++){
        int n, k;
        cin >> n >> k;
        if (k%3 != 0){
            cout << w[n%3] << endl;
        } else {
            if (n == k){
                cout << "Alice" << endl;
            } else {
                cout << solve(n, k) << endl;
            }
        }
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vs;

vs w = {"Bob", "Alice", "Alice"};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);

    int t;
    cin >> t;
    for (int T = 0; T < t; T++){
        int n, k;
        cin >> n >> k;
        if (k%3 != 0){
            cout << w[n%3] << endl;
        } else {
            if (n%(k+1) == k){
                cout << "Alice" << endl;
            } else {
                cout << w[n%(k+1)%3] << endl;
            }
        }
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vs;

vs w = {"Bob", "Alice", "Alice"};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);

    int t;
    cin >> t;
    for (int T = 0; T < t; T++){
        int n, k;
        cin >> n >> k;
        if (k%3 != 0){
            cout << w[n%3] << endl;
        } else {
            if (n == k){
                cout << "Alice" << endl;
            } else {
                if (n < k){
                    cout << w[n%3] << endl;
                } else {
                    if (n%(k+1) == k){
                        cout << "Alice" << endl;
                    } else {
                        cout << w[n%(k+1)%3] << endl;
                    }
                }
            }
        }
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vs;

void solve() {
    int n, k;
    cin >> n >> k;
    if (k%3 != 0){
        if (n%3 == 0){
            cout << "Bob" << endl;
        } else {
            cout << "Alice" << endl;
        }
    } else {
        n %= (k+1);
        if (n == k || n%3 != 0){
            cout << "Alice" << endl;
        } else {
            cout << "Bob" << endl;
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);

    int t;
    cin >> t;
    while (t--){
        solve();
    }

    return 0;
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vs;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);

    int t;
    cin >> t;
    for (int T = 0; T < t; T++){
        int n, k;
        cin >> n >> k;
        vs w = {"Bob", "Alice", "Alice"};
        if (k%3 != 0){
            cout << w[n%3] << endl;
        } else {
            // 0 1 2 0 1 2 ... 0 1 2 3 ... 0 1 2 0 1 2
            if (n == k){
                cout << "Alice" << endl;
            } else if (n < k){
                cout << w[n%3] << endl;
            } else {
                // n > k
                cout << w[(n+2)%3] << endl;
            }
        }
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(n == 1 || n == 2 || n == K) {
				puts("Alice");
			} else {
				if(n % 3) {
					if(K % 3) {
						puts("Alice");
					} else {
						int t = n / 3;
						int b = K / 3;
						//printf("t=%d,b=%d\n", t, b);
						if(t % b)
							puts("Bob");
						else
							puts("Alice");
					}

				} else {
					if(K % 3) {
						puts("Bob");
					} else {
						int t = n / 3;
						int b = K / 3;
					//	printf("t=%d,b=%d\n",t,b);
						if(t % b) puts("Bob");
						else puts("Alice");
					}
				}
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(n == 1 || n == 2 || n == K) {
				puts("Alice");
			} else {
				if(n % 3) {
					puts("Alice");
				} else {
					if(K % 3) {
						puts("Bob");
					} else {
						int t = n / 3;
						int b = K / 3;
						if(t %(2*b)) puts("Alice");
						else puts("Bob");
					}
				}
			/*	if(K % 3) {
					if(n % 3 == 0) {
						puts("Bob");
					} else puts("Alice");
				} else {
					if(n % 3 == 0) {
						int t = n / 3;
						int b = K / 3;
						if(t %(2*b)) puts("Alice");
						else puts("Bob");
					} else puts("Alice");
				}*/
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(n == 1 || n == 2 || n == K) {
				puts("Alice");
			} else {
				if(K % 3) {
					if(n % 3 == 0) {
						puts("Bob");
					} else puts("Alice");
				} else {
					if(n % 3 == 0) {
						puts("Bob");
					} else puts("Alice");
				}
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(K % 3) {
			puts(n % 3 ? "Alice" : "Bob");
		} else {
			n %= (K+1);
			if(n % 3 || n == K) {
				puts("Alice");
			} else puts("Bob");

		}
	/*	if(n == 0) {
			puts("Bob");
		} else {
			if(n == 1 || n == 2 || n == K) {
				puts("Alice");
			} else {
				if(n % 3) {
					if(K % 3) {
						puts("Alice");
					} else {
						int t = n / 3;
						int b = K / 3;
						if(t % b)
							puts("Bob");
						else
							puts("Alice");
					}

				} else {
					if(K % 3) {
						puts("Bob");
					} else {
						int t = n / 3;
						int b = K / 3;
					//	printf("t=%d,b=%d\n",t,b);
						if(t % b) puts("Bob");
						else puts("Alice");
					}
				}
			}
		}*/
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(n == 1 || n == 2 || n == K) {
				puts("Alice");
			} else {
				if(n % 3) {
					if(K % 3) {
						puts("Alice");
					} else {
						int m = n - n % 3;
						int t = n / 3;
						int b = K / 3;
						if(t % (2 * b))
							puts("Bob");
						else
							puts("Alice");
					}

				} else {
					if(K % 3) {
						puts("Bob");
					} else {
						int t = n / 3;
						int b = K / 3;
						if(t %(2*b)) puts("Alice");
						else puts("Bob");
					}
				}
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(K >= n) {
				puts("Alice");
				continue;
			}
			if(n % K == 0) {
				puts("Alice");
			} else puts("Bob");
		}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(n == 1 || n == 2 || n == K) {
				puts("Alice");
			} else {
				if(K % 3) {
					if(n % 3 == 0) {
						puts("Bob");
					} else puts("Alice");
				} else {
					if(n % 3 == 0) {
						int t = n / 3;
						int b = K / 3;
						if(t %(2*b)) puts("Alice");
						else puts("Bob");
					} else puts("Alice");
				}
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(n % K == 0) {
				puts("Alice");
			} else puts("Bob");
		}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(n == 1 || n == 2 || n == K) {
				puts("Alice");
			} else {
				if(n % 3) {
					if(K % 3) {
						puts("Alice");
					} else {
						int t = n / 3;
						int b = K / 3;
						if(t % b)
							puts("Alice");
						else
							puts("Bob");
					}

				} else {
					if(K % 3) {
						puts("Bob");
					} else {
						int t = n / 3;
						int b = K / 3;
					//	printf("t=%d,b=%d\n",t,b);
						if(t % b) puts("Bob");
						else puts("Alice");
					}
				}
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main(){
	int T;
	scanf("%d",&T);
	while(T--) {
		int n, K;
		scanf("%d%d",&n,&K);
		if(n == 0) {
			puts("Bob");
		} else {
			if(n == 1 || n == 2 || n == K) {
				puts("Alice");
			} else {
				if(K % 3) {
					if(n % 3 == 0) {
						puts("Bob");
					} else puts("Alice");
				} else {
					if(n % 3 == 0) {
						int t = n / 3;
						if(t & 1) puts("Alice");
						else puts("Bob");
					} else puts("Alice");
				}
			}
		}
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int T;cin>>T;int cnt=1;
    while(T--){
        int n,k;cin>>n>>k;
        if(n){
            if(k>n){
                if(n%3)cout<<"Alice"<<endl;
                else cout<<"BOb"<<endl;
            }
            else if(k==n)cout<<"Alice"<<endl;
            else{
                if(k%3){
                    if(n%3)cout<<"Alice"<<endl;
                    else cout<<"Bob"<<endl;
                }
                else{
                    int de=k/3-1;
                    int ce=de*3+4;
                    if((n-k)%ce){
                        int e=(n-k)%ce;
                        if(e>de*3){
                            if(e-de*3==1)cout<<"Bob"<<endl;
                            else cout<<"Alice"<<endl;
                        }
                        else{
                            if(e%3!=1)cout<<"Alice"<<endl;
                            else cout<<"Bob"<<endl;
                        }

                    }
                    else cout<<"Alice"<<endl;
                }
            }
        }
        else cout<<"Bob"<<endl;
        cnt++;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int T;cin>>T;
    while(T--){
        int n,k;cin>>n>>k;
        if(n){
            if(k>n){
                if(n%3)cout<<"Alice"<<endl;
                else cout<<"BOb"<<endl;
            }
            else if(k==n)cout<<"Alice"<<endl;
            else{
                if(k%3){
                    if(n%3)cout<<"Alice"<<endl;
                    else cout<<"Bob"<<endl;
                }
                else{
                    int de=k/3-1;
                    int ce=de*2+3;
                    if(n%ce){
                        int e=n%ce;
                        if(e%3)cout<<"Alice"<<endl;
                        else cout<<"Bob"<<endl;
                    }
                    else cout<<"Bob"<<endl;
                }
            }
        }
        else cout<<"Bob"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int T;cin>>T;int cnt=1;
    while(T--){
        int n,k;cin>>n>>k;
        cout<<cnt<<" ";
        if(n){
            if(k>n){
                if(n%3)cout<<"Alice"<<endl;
                else cout<<"BOb"<<endl;
            }
            else if(k==n)cout<<"Alice"<<endl;
            else{
                if(k%3){
                    if(n%3)cout<<"Alice"<<endl;
                    else cout<<"Bob"<<endl;
                }
                else{
                    int de=k/3-1;
                    int ce=de*3+4;
                    if((n-k)%ce){
                        int e=(n-k)%ce;
                        if(e>de*3){
                            if(e-de*3==1)cout<<"Bob"<<endl;
                            else cout<<"Alice"<<endl;
                        }
                        else{
                            if(e%3!=1)cout<<"Alice"<<endl;
                            else cout<<"Bob"<<endl;
                        }

                    }
                    else cout<<"Alice"<<endl;
                }
            }
        }
        else cout<<"Bob"<<endl;
        cnt++;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int T;cin>>T;
    while(T--){
        int n,k;cin>>n>>k;
        if(n){
            if(k>n){
                if(n%3)cout<<"Alice"<<endl;
                else cout<<"Bob"<<endl;
            }
            else if(k==n)cout<<"Alice"<<endl;
            else{
                if(k%3){
                    if(n%3)cout<<"Alice"<<endl;
                    else cout<<"Bob"<<endl;
                }
                else{
                    int de=k/3-1;
                    int ce=de*2+3;
                    if(n%ce){
                        int e=n%ce;
                        if(e%3)cout<<"Alice"<<endl;
                        else cout<<"Bob"<<endl;
                    }
                    else cout<<"Bob"<<endl;
                }
            }
        }
        else cout<<"Bob"<<endl;
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    int T;cin>>T;int cnt=1;
    while(T--){
        int n,k;cin>>n>>k;
        if(n){
            if(k>n){
                if(n%3)cout<<"Alice"<<endl;
                else cout<<"Bob"<<endl;
            }
            else if(k==n)cout<<"Alice"<<endl;
            else{
                if(k%3){
                    if(n%3)cout<<"Alice"<<endl;
                    else cout<<"Bob"<<endl;
                }
                else{
                    int de=k/3-1;
                    int ce=de*3+4;
                    if((n-k)%ce){
                        int e=(n-k)%ce;
                        if(e>de*3){
                            if(e-de*3==1)cout<<"Bob"<<endl;
                            else cout<<"Alice"<<endl;
                        }
                        else{
                            if(e%3!=1)cout<<"Alice"<<endl;
                            else cout<<"Bob"<<endl;
                        }

                    }
                    else cout<<"Alice"<<endl;
                }
            }
        }
        else cout<<"Bob"<<endl;
        cnt++;
    }
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int p;
int n, k;
int solve(int x){
    x = x % (k + 1);
    if (x == k)
        return 1;
    return x % 3;
}
int solve2(int x){
    x = x % (k + 2);
    if (x == k + 1){
        if (!solve2(k - 1) || !solve2(x - k))
            return 1;
        else
            return 0;
    }
    if (x == k)
        return 1;
    return x % 3;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        cin >> n >> k;
        bool ans;
        if (k % 2)
            ans = solve(n);
        else
            ans = solve2(n);
        if (ans)
            cout << "Alice\n";
        else cout << "Bob\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int p;
int n, k;
int solve(int x){
    x = x % (k + 1);
    if (x == k)
        return 1;
    return x % 3;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        cin >> n >> k;
        k += k % 3 * 1e9;
        if (solve(n))
            cout << "Alice\n";
        else cout << "Bob\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int p;
int n, k;
int solve(int x){
    x = x % (k + 1);
    if (x == k)
        return 1;
    return x % 3;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        cin >> n >> k;
        if (solve(n))
            cout << "Alice\n";
        else cout << "Bob\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int p;
int n, k;
int solve(int x){
    x = x % (k + 1);
    if (x == k)
        return 1;
    return x % 3;
}
int solve2(int x){
    x = x % (k + 2);
    if (x == k + 1){
        if (!solve2(k - 1) || !solve2(x - k))
            return 1;
        else
            return 0;
    }
    if (x == k)
        return 1;
    return x % 3;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        cin >> n >> k;
        bool ans;
        if (n % 3 != 0){
            cout << "Alice\n";
            continue;
        }
        if (k % 2)
            ans = solve(n);
        else
            ans = solve2(n);
        if (ans)
            cout << "Alice\n";
        else cout << "Bob\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int p;
int n, k;
int solve(int x){
    x = x % (k + 1);
    if (x == k)
        return 1;
    return x % 3;
}
int solve2(int x){
    x = x % (k);
    if (x == k + 1){
        if (!solve2(k - 1) || !solve2(x - k))
            return 1;
        else
            return 0;
    }
    if (x == k)
        return 1;
    return x % 3;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        cin >> n >> k;
        bool ans;
        if (k % 2)
            ans = solve(n);
        else
            ans = solve2(n);
        if (ans)
            cout << "Alice\n";
        else cout << "Bob\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int fp[N];
int main()
{
    int t;
    cin >> t;
    while(t--){
        int n, k;
        cin >> n >> k;
        int a = n % k , b = n / k;
        b %= 2;
        if (b == 0){
            if (a % 3){
                cout << "Alice\n";
            }
            else {
                cout <<"Bob\n";
            }
        }
        else {
            if (a % 3){
                cout << "Bob\n";
            }
            else {
                cout <<"Alice\n";
            }
        }
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int p;
int n, k;
int solve(int x){
    x = x % (k + 2);
    if (x == k + 1)
        return p;
    if (x == k)
        return 1;
    return x % 3;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        cin >> n >> k;
        p = 0;
        if ((k - 1) % 3 == 0)
            p = 1;
        if (solve(n))
            cout << "Alice\n";
        else cout << "Bob\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int p;
int n, k;
int solve(int x){
    x = x % (k + 1);
    if (x == k)
        return 1;
    return x % 3;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        cin >> n >> k;
        if (n % 3 != 0){
            cout << "Alice\n";
            continue;
        }
        if (solve(n))
            cout << "Alice\n";
        else cout << "Bob\n";
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 105;
int p;
int n, k;
int solve(int x){
    x = x % (k + 1);
    if (x == k)
        return 1;
    return x % 3;
}
int solve2(int x){
    x = x % (k + 2);
    if (x == k + 1){
        if (!solve2(k - 1) || !solve2(x - k))
            return 1;
        else
            return 0;
    }
    if (x == k)
        return 1;
    return x % 3;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        cin >> n >> k;
        bool ans;
        if (k % 3 != 0){
            cout << "Alice\n";
            continue;
        }
        if (k % 2)
            ans = solve(n);
        else
            ans = solve2(n);
        if (ans)
            cout << "Alice\n";
        else cout << "Bob\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define x first
#define y second

using namespace std;

const int N=1e5+2;
const int MOD=1e9+7;
const int bm=1;
int n,m,t;

void sinh()
{
    freopen(".inp","w",stdout);
    srand(time(0));
}

int main()
{
    ios_base::sync_with_stdio(0);
    //sinh();
    //freopen(".inp","r",stdin);
    //freopen(".out","w",stdout);
    cin>>t;
    while(t--)
    {
        cin>>n>>m;
        int kq=0;
        if ( n%3 ) kq=1;
        if ( n == 1 || n == 2 || n == m ) kq=1;
        if ( m%3 == 0 && m != 3 )
        {
            n%=(m-2);
            if ( n ) kq=((n%3)>0);
            else kq=1;

        }
        if ( m == 3 ) kq=((n%4)>0);
        if ( kq == 1 ) cout<<"Alice";
        else cout<<"Bob";
        cout<<endl;
    }
}


#include <bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define x first
#define y second

using namespace std;

const int N=1e5+2;
const int MOD=1e9+7;
const int bm=1;
int n,m,t;

void sinh()
{
    freopen(".inp","w",stdout);
    srand(time(0));
}

int main()
{
    ios_base::sync_with_stdio(0);
    //sinh();
    //freopen(".inp","r",stdin);
    //freopen(".out","w",stdout);
    cin>>t;
    while(t--)
    {
        cin>>n>>m;
        int kq=0;
        if ( n%3 ) kq=1;
        if ( m%3 == 0 && m != 3 ) n%=(m-2);
        {if ( n < m - 2 ) kq=((n%3)>0);
        if ( n == m-2 ) kq=1;
        if ( m == 3 ) kq=((n%4)>0);
        }
        if ( kq == 1 ) cout<<"Alice";
        else cout<<"Bob";
        cout<<endl;
    }
}


#include <bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define x first
#define y second

using namespace std;

const int N=1e5+2;
const int MOD=1e9+7;
const int bm=1;
int n,m,t;

void sinh()
{
    freopen(".inp","w",stdout);
    srand(time(0));
}

int main()
{
    ios_base::sync_with_stdio(0);
    //sinh();
    //freopen(".inp","r",stdin);
    //freopen(".out","w",stdout);
    cin>>t;
    while(t--)
    {
        cin>>n>>m;
        int kq=0;
        if ( n%3 ) kq=1;
        if ( n == 1 || n == 2 || n == m ) kq=1;
        if ( m%3 == 0 && m != 3 && n > m )
        {
            n%=(m-2);
            if ( n ) kq=((n%3)>0);
            else kq=1;
        }
        if ( m == 3 ) kq=((n%4)>0);
        if ( kq  ) cout<<"Alice";
        else cout<<"Bob";
        cout<<endl;
    }
}


#include <bits/stdc++.h>
#define pb push_back
#define ii pair<int,int>
#define x first
#define y second

using namespace std;

const int N=1e5+2;
const int MOD=1e9+7;
const int bm=1;
int n,m,t;

void sinh()
{
    freopen(".inp","w",stdout);
    srand(time(0));
}

int main()
{
    ios_base::sync_with_stdio(0);
    //sinh();
    //freopen(".inp","r",stdin);
    //freopen(".out","w",stdout);
    cin>>t;
    while(t--)
    {
        cin>>n>>m;
        int kq=0;
        if ( n%3 ) kq=1;
        if ( m % 3 == 0 )
        {
            n%=m+1;
            if ( n == 0 ) kq=0;
            else if ( n <= 3*m-3 ) kq=(n%3>0);
            else kq=1;
        }
        if ( kq  ) cout<<"Alice";
        else cout<<"Bob";
        cout<<endl;
    }
}