      program main
      read(*,*) i, j, k
      if (abs(i - j) .lt. abs(i-k)) then
            write(*,*) "A"
      else
            write(*,*) "B"
      end if
      end

      function abs(a)
      integer abs, a
      if (a > 0) then
            abs = a
      else
            abs = -1 * a
      end if
      end function