#include <bits/stdc++.h>
using namespace std;
#define ll long long int
void mainSolve()
{
int x,y,z;
cin>>x>>y>>z;
if(z % x == 0 && z % y != 0)
cout <<"CHICKEN"<<endl;
else if(z % x != 0 && z%y == 0)
cout <<"DUCK"<<endl;
else if(z % x == 0 && z % y == 0)
cout <<"ANY"<<endl;
else if(z % x != 0 && z % y != 0)
cout <<"NONE"<<endl;
}
int main()
{
int t;
cin>>t;
while (t--)
{
mainSolve();
}
return 0;
}