import Control.Applicative
import Data.Char

judge :: String -> String -> String
judge [] [] = "EQUAL"
judge (x:xs) (y:ys) 
          | ord x > ord y     = "GREATER"
          | ord x < ord y     = "LESS"
          | otherwise         = judge xs ys

main :: IO ()
main = do
  num1 <- getLine
  num2 <- getLine
  putStrLn $ case length num1 == length num2 of
               True -> judge num1 num2
               False -> if length num1 > length num2 then "GREATER"
                                                     else "LESS"