IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 ln         PIC X(400).
01 maxlen     PIC 9(10) VALUE 100 COMP.
01 cur        PIC 9(10) VALUE 1 COMP.
01 i          PIC 9(10) VALUE 1 COMP.
01 j          PIC 9(10) COMP.
01 len        PIC 9(10) COMP.
01 ans        PIC X(200).
01 N          PIC 9(10).
01 S          PIC X(100).
01 T          PIC X(100).

PROCEDURE DIVISION.
  ACCEPT N.
  ACCEPT ln.
  UNSTRING ln DELIMITED BY SPACE INTO S T.
  PERFORM VARYING i FROM 1 BY 1 UNTIL N < i
    STRING ans S(i : 1) T(i : 1) DELIMITED BY SPACE INTO ans
  END-PERFORM.
  DISPLAY FUNCTION TRIM(ans).
  STOP RUN.
