IDENTIFICATION DIVISION.
PROGRAM-ID. KLOSETTROD.

DATA DIVISION.
WORKING-STORAGE SECTION.
  01 INP PIC X(2000).
  01 N   PIC S9(4).

PROCEDURE DIVISION.
  PERFORM
    ACCEPT N
    ACCEPT INP
    DISPLAY function TRIM(function REVERSE(INP))
  END-PERFORM.
