character(200) A,B
read*,A,B
if( len_trim(A) > len_trim(B))print"(A)","GREATER"
if( len_trim(A) < len_trim(B))print"(A)","LESS"
if( len_trim(A) == len_trim(B))then
do i=1,len_trim(A)
 if( ichar(A(i:i)) > ichar(B(i:i)))then
   print"(A)","GREATER"
   STOP
 end if
 if( ichar(A(i:i)) < ichar(B(i:i)))then
   print"(A)","LESS"
   STOP
 end if
end do
print"(A)","EQUAL"
endif
end