import Control.Applicative ((<$>)) import Data.ByteString.Char8 (ByteString) import qualified Data.ByteString.Char8 as B import Data.List (unfoldr) import Data.Char (isSpace) main :: IO () main = do B.getLine solve <$> map (readil B.readInteger) <$> B.lines <$> B.getContents >>= mapM_ B.putStrLn solve :: [[Integer]] -> [ByteString] solve = map f where f [d, x, t] | hp (x+1) (d-1) <= t = B.pack "AC" | otherwise = B.pack "ZETUBOU" comb :: Integer -> Integer -> Integer comb n m | m == 0 = 1 | n < 2 * m = comb n (n - m) | otherwise = comb (n-1) (m-1) * n `div` m hp :: Integer -> Integer -> Integer hp n m = comb (n+m-1) m readil :: Integral a => (ByteString -> Maybe (a, ByteString)) -> ByteString -> [a] readil f = unfoldr g where g s = do (n, s') <- f s return (n, B.dropWhile isSpace s')