{-# LANGUAGE OverloadedStrings #-} import qualified Data.ByteString.Lazy.Char8 as LC import qualified Data.ByteString.Char8 as SC import Data.Maybe (fromJust) data Status = AC | ZETUBOU deriving (Enum, Show) type Query a = (a, a, a) binom :: Integral a => a -> a -> a binom n k = product [k + 1 .. n] `div` product [1 .. n - k] querify :: [a] -> Query a querify [x, y, z] = (x, y, z) querify _ = error "the length of the list must be three" judge :: Integral a => Query a -> Status judge (d, x, t) | binom (x + d - 1) x <= t = AC | otherwise = ZETUBOU unsafeReadInteger :: LC.ByteString -> Integer unsafeReadInteger = fst . fromJust . LC.readInteger showStatus :: Status -> SC.ByteString showStatus AC = "AC" showStatus ZETUBOU = "ZETUBOU" main :: IO () main = do _ <- SC.getLine SC.putStr . SC.unlines . fmap (showStatus . judge . querify . fmap unsafeReadInteger . LC.words) . LC.lines =<< LC.getContents