program ABC_059_B_Comparison
   implicit none
   character(100) A, B
   read(*, *) A, B
   if(A == B) then 
      write(*, *)'EQUAL'
   else if(len_trim(A) > len_trim(B)) then
      write(*, *)'GREATER'
   else if(len_trim(A) < len_trim(B)) then
      write(*, *)'LESS'
   else if(LGE(A, B) .eqv. .TRUE.) then
      write(*, *)'GREATER'
   else
      write(*, *)'LESS'
   end if
end program ABC_059_B_Comparison