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 = getLine >> solve <$> readil B.readInt <$> B.getLine >>= putStrLn solve :: [Int] -> String solve xs | even s = "B" | otherwise = if xs2 == [2] || xs2 == [] then "A" else "B" where s = sum xs xs2 = filter (>= 2) xs 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')