main = do
    a <- getLine
    b <- getLine
    putStrLn $ ans (pushZero a b) (pushZero b a)

zeroString 0 = ""
zeroString n = "0" ++ zeroString (n - 1)

pushZero a b = if la > lb
    then a 
    else  zeroString (lb - la) ++ a
    where la = length a
          lb = length b

ans a b
    | a > b = "GREATER"
    | a < b = "LESS"
    | a == b = "EQUAL"