local as = io.read()
local bs = io.read()
local n, m = #as, #bs
local a, b = {}, {}
for i = 1, n do
  a[i] = as:sub(i, i)
end
for i = 1, m do
  b[i] = bs:sub(i, i)
end
if n < m then
  print("LESS")
elseif m < n then
  print("GREATER")
else
  local f = 0
  for i = 1, n do
    if a[i] < b[i] then
      f = 1
      break
    elseif b[i] < a[i] then
      f = -1
      break
    end
  end
  if f == 1 then
    print("LESS")
  elseif f == -1 then
    print("GREATER")
  else
    print("EQUAL")
  end
end
