{-# LANGUAGE OverloadedStrings #-}

module Main where

import qualified Data.Text as T
import qualified Data.Text.IO as T

main :: IO()
main = do
  input <- T.getLine
  T.putStrLn . solve $ input

solve :: T.Text -> T.Text
solve = (\(a, b) -> if a > b
                    then "B"
                    else "A")
  . toAbsPair
  . T.words

toAbsPair :: [T.Text] -> (Int, Int)
toAbsPair (x:y:z) = toAbss . toInts $ (x, y, head z)
toAbsPair _ = error ""

toInts :: (T.Text, T.Text, T.Text) -> (Int, Int, Int)
toInts (xs, as, bs) = (read $ T.unpack xs, read $ T.unpack as, read $ T.unpack bs)

toAbss :: (Int, Int, Int) -> (Int, Int)
toAbss (x, a, b) = (abs (x - a), abs (x - b))
