IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_087_A.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 X      PIC 9(5).
    01 A      PIC 9(4).
    01 B      PIC 9(4).
    01 D      PIC 9(3).
    01 R      PIC 9(3).
    01 ZS     PIC Z(3)9.
    01 ans    PIC X(3).
    01 DUMMY  PIC X(1).
PROCEDURE                        DIVISION.
MAIN.
    ACCEPT X.
    ACCEPT A.
    ACCEPT B.

    SUBTRACT A FROM X.
    DIVIDE B INTO X GIVING D REMAINDER R.

    MOVE R TO ZS.

    PERFORM UNANS.

    DISPLAY ans(1:FUNCTION STORED-CHAR-LENGTH(ans)).
    STOP RUN.

UNANS                            SECTION.
    UNSTRING
        ZS DELIMITED BY ALL SPACE
        INTO DUMMY ans
    END-UNSTRING.
