       IDENTIFICATION                   DIVISION.
       PROGRAM-ID.                      PRACTIVE-B.
       ENVIRONMENT                      DIVISION.
       DATA                             DIVISION.
       WORKING-STORAGE                  SECTION.
       01 NAGASA                        PIC 9(3).
       01 I-DATA                        PIC X(100).
       01 TUIKA-DATA                    PIC X(3) VALUE '...'.
       01 O-DATA                        PIC X(100).
       01 IDX                           PIC 9(3).
       01 END-FLAG                      PIC 9(1).
       PROCEDURE DIVISION.
       MAIN-SECTION.
           ACCEPT    NAGASA  FROM  SYSIN.
           ACCEPT    I-DATA  FROM  SYSIN.
           MOVE      1  TO IDX.
           MOVE      0  TO END-FLAG
      
           PERFORM  UNTIL  IDX  >  NAGASA OR END-FLAG = 1
      		 IF I-DATA(IDX:1) NOT = SPACE
             THEN
      		     CONTINUE
             ELSE
                 DISPLAY I-DATA
                 MOVE  1  TO  END-FLAG
             END-IF
             COMPUTE  IDX = IDX + 1 
           END-PERFORM.
      
           IF  IDX  >  NAGASA
           THEN
               MOVE I-DATA(1:NAGASA) TO O-DATA
               MOVE TUIKA-DATA  TO O-DATA(IDX:3)
               DISPLAY O-DATA
           ELSE
      		   CONTINUE
           END-IF.
           STOP RUN.
