local A, B = io.read("l", "l")
if #A ~= #B then
  print(#A>#B and "GREATER" or "LESS")
else
  for i=1,#A do
    local a,b = A:sub(i,i), B:sub(i,i)
    if a~=b then
      print(a>b and "GREATER" or "LESS")
      return
    end
  end
  print("EQUAL")
end