#include<stdio.h>
#include<string.h>

int main()
{int t;
long long int n,b,g,z,d;
char s[100]="";
char s1[]="Tak\n";
char s2[]="Nie\n";
scanf("%d",&t);
for(int i=0;i<t;i++)
{scanf("%d%d%d",&n,&b,&g);
d=n/g;
if(d%2==0){z=g*((d+1)*(d/2));}
else {z=g*(((d+1)/2)*d);}
z+=(n%g)*(d+1);
if(z<=b)printf("%s",s1);
 else printf("%s",s2);
}


    return 0;
}