 IDENTIFICATION DIVISION.
 PROGRAM-ID.    TEST154.
 
 DATA DIVISION.
 WORKING-STORAGE SECTION.

 01 INP       PIC X(30).
 01 S         PIC X(10).
 01 T         PIC X(10).
 01 A         PIC 9(2).
 01 B         PIC 9(2).
 01 U         PIC X(10).
 01 ANS-A     PIC Z9.
 01 ANS-B     PIC Z9.

 PROCEDURE DIVISION.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ALL ' '
      INTO S T.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ALL ' '
      INTO A B.
  ACCEPT INP.
  MOVE INP  TO U.

  IF S = U
    COMPUTE ANS-A = A - 1
    MOVE B  TO ANS-B
  ELSE
    MOVE A  TO ANS-A
    COMPUTE ANS-B = B - 1
  END-IF.
  
  DISPLAY ANS-A ANS-B.
 STOP RUN.   