combi :: Integral a => a -> a -> a combi n m = product [n, n - 1 .. n - m + 1] `div` product [1 .. m] judge :: Integer -> Integer -> Integer -> String judge d x t | (<= t) $ flip combi x $ x + d - 1 = "AC" | otherwise = "ZETUBOU" main :: IO () main = do _ <- getLine putStr . unlines . map (\(d : x : t : _) -> judge d x t) . map (map read) . map words . lines =<< getContents