IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 ln         PIC X(30).
01 A          PIC 9(10).
01 B          PIC 9(10).
01 num        PIC 9(10).
01 qt         PIC 9(10).
01 rm         PIC 9(10).
01 ans        PIC X(30).
01 zs         PIC Z(9)9.

PROCEDURE DIVISION.
  ACCEPT ln.
  UNSTRING ln DELIMITED BY SPACE INTO A B.
  COMPUTE num = A + B
  DIVIDE num BY 2 GIVING qt REMAINDER rm.
  IF ZERO = rm
    MOVE qt TO zs
    DISPLAY FUNCTION TRIM(zs)
  ELSE
    DISPLAY "IMPOSSIBLE"
  END-IF.
  STOP RUN.
