import           Control.Monad
import           Control.Applicative

main :: IO ()
main = do
  a <- getLine
  b <- getLine

  putStrLn $ f a b

f :: String -> String -> String
f a b | length a > length b = "GREATER"
      | length a < length b = "LESS"
      | otherwise           = f' a b

f' :: String -> String -> String
f' "" "" = "EQUAL"
f' (a : as) (b : bs) | toInt [a] > toInt [b] = "GREATER"
                     | toInt [a] < toInt [b] = "LESS"
                     | otherwise             = f as bs

toInt s = read s :: Intimport           Control.Monad
import           Control.Applicative

main :: IO ()
main = do
  a <- getLine
  b <- getLine

  putStrLn $ f a b

f :: String -> String -> String
f a b | length a > length b = "GREATER"
      | length a < length b = "LESS"
      | otherwise           = f' a b

f' :: String -> String -> String
f' "" "" = "EQUAL"
f' (a : as) (b : bs) | toInt [a] > toInt [b] = "GREATER"
                     | toInt [a] < toInt [b] = "LESS"
                     | otherwise             = f as bs

toInt s = read s :: Int