PROGRAM mas
IMPLICIT NONE
INTEGER::n,s,i,a,m
READ*,m,n
IF (n>m) THEN
a=m
m=n
n=a
END IF
DO i=1,n
IF (MOD(n,i)==0) THEN
IF (MOD(m,i)==0) THEN
PRINT*,i
END IF
END IF
END DO
END
PROGRAM mas
IMPLICIT NONE
INTEGER::n,s,i,a,m
READ*,m,n
IF (n>m) THEN
a=m
m=n
n=a
END IF
DO i=1,n
IF (MOD(n,i)==0) THEN
IF (MOD(m,i)==0) THEN
PRINT*,i
END IF
END IF
END DO
END