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

solve a b | la > lb = "GREATER"
          | la < lb = "LESS"
          | la == lb = solve' a b
      where la = length a
            lb = length b

solve' [] [] = "EQUAL"
solve' (a : as) (b : bs) | a == b = solve' as bs
                         | a > b = "GREATER"
                         | a < b = "LESS"