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 filter (>= 2) xs == [2] then "A" else "B" where s = sum 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')