IDENTIFICATION DIVISION.
PROGRAM-ID. ABC110B.

DATA DIVISION.
WORKING-STORAGE SECTION.
77 N PIC 9(3).
77 M PIC 9(3).
77 X PIC S9(4).
77 Y PIC S9(4).
77 T PIC S9(4).
77 L PIC X(500).
77 PTR PIC 9(3).

PROCEDURE DIVISION.
ACCEPT L.
UNSTRING L DELIMITED ALL SPACE INTO N, M, X, Y.
ACCEPT L.
MOVE 1 TO PTR.
PERFORM N TIMES
UNSTRING L DELIMITED ALL SPACE INTO T POINTER PTR
IF X < T
  MOVE T TO X
END-IF
END-PERFORM.
ACCEPT L.
MOVE 1 TO PTR.
PERFORM M TIMES
UNSTRING L DELIMITED ALL SPACE INTO T POINTER PTR
IF T < Y
  MOVE T TO Y
END-IF
END-PERFORM.
IF X < Y
  DISPLAY "No War"
ELSE
  DISPLAY "War"
END-IF.
STOP RUN.
