 IDENTIFICATION DIVISION.
 PROGRAM-ID.     TEST103.
 DATA DIVISION.
 WORKING-STORAGE SECTION.
  01 INP        PIC X(400).
  01 A1         PIC 9(3).
  01 A2         PIC 9(3).
  01 A3         PIC 9(3).
  01 WANS       PIC 9(2).
  01 ANS        PIC Z9.

 PROCEDURE DIVISION.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ALL ' '
      INTO A1 A2 A3.

  EVALUATE TRUE
      WHEN (A1 <= A2 AND A2 <= A3) OR
           (A1 >= A2 AND A2 >= A3)
        COMPUTE WANS = A1- A3
      WHEN (A2 <= A1 AND A1 <= A3) OR 
           (A2 >= A1 AND A1 >= A3)
        COMPUTE WANS = A2 - A3
      WHEN (A1 <= A3 AND A3 <= A2) OR
           (A1 >= A3 AND A3 >= A2)
        COMPUTE WANS = A1 - A2
  END-EVALUATE.
  MOVE WANS     TO ANS.
  DISPLAY FUNCTION TRIM(ANS).
 STOP RUN.