000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. TWO_RECTANGLES.
000300 DATA DIVISION.
000301 WORKING-STORAGE SECTION.
000302 01 S PIC X(23).
000303 01 S1 PIC X(05).
000304 01 S2 PIC X(05).
000305 01 S3 PIC X(05).
000306 01 S4 PIC X(05).
000307 01 A PIC 9(05).
000308 01 B PIC 9(05).
000309 01 C PIC 9(05).
000310 01 D PIC 9(05).
000311 01 I PIC 9(01).
000312 01 P PIC 9(09).
000400 PROCEDURE DIVISION.
000401 MAIN SECTION.
000402     ACCEPT S FROM SYSIN.
000403     UNSTRING S DELIMITED BY SPACE INTO S1, S2, S3, S4.
000404     MOVE S1 TO A.
000405     MOVE S2 TO B.
000406     MOVE S3 TO C.
000407     MOVE S4 TO D.
000407     COMPUTE P = FUNCTION MAX(A*B,C*D)
000408     COMPUTE I = 9 - FUNCTION INTEGER(FUNCTION LOG10(P)).
000409     DISPLAY P(I:) UPON SYSOUT.
000410     STOP RUN.