import Data.Char (digitToInt)

main :: IO ()
main = do
  a <- getLine :: IO String 
  b <- getLine :: IO String
  putStr $ test a b 

test :: String -> String -> String
test as bs
  | as == bs = "EQUAL"
  | length as > length bs = "GREATER"
  | length as < length bs = "LESS"
  | otherwise = testEach as bs

testEach :: String -> String -> String
testEach (a:as) (b:bs)
  | digitToInt a > digitToInt b = "GERATER"
  | digitToInt a < digitToInt b = "LESS"
  | otherwise = testEach as bs

