q = readline().to_i
ans = []
for u in 1..q do
  c = readline().split()
  d = c[0].to_i
  x = c[1].to_i
  t = c[2].to_i
  count = 1
  for i in 1..(d-1) do
    count = count * (x + i) / i
    if count > t
      break
    end
  end
  if count > t
    puts "ZETUBOU"
  else
    puts "AC"
  end
end