long t,s;x,d;main(i){for(gets(&i);~scanf("%d%d%ld",&d,&x,&t);puts(s>t?"ZETUBOU":"AC"))for(x+=d,s=i=1;i