program main
    character (10) :: cx, ca, cb
    integer :: x, a, b
    read *, cx, ca, cb
    read (cx, *) x
    read (ca, *) a
    read (cb, *) b
    if (abs(x-a) < abs(x-b)) then
        print *, "A"
    else
        print *, "B"
    end if
end program main