import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Data.Char
import qualified Data.Set as S

main = do
  a <- getLine
  b <- getLine
  putStrLn $ judge a b

judge::String -> String -> String
judge a b
  | length a > length b = "GREATER"
  | length a < length b = "LESS"
  | a > b = "GREATER"
  | a < b = "LESS"
  | otherwise = "EQUAL"

