A, B = io.read("*n", "*n")
if #A>#B then
    print("GREATER")
elseif #A<#B then
    print("LESS")    
elseif #A==#B then
    A = tostring(A)
    B = tostring(B)
    i = 1
    while A:sub(i,i) == B:sub(i,i) do
        i = i+1
    end
    if tonumber(A:sub(i,i)) > tonumber(B:sub(i,i)) then
        print("GREATER")
    elseif tonumber(A:sub(i,i)) < tonumber(B:sub(i,i)) then
        print("LESS")
    elseif i==100 then
        print("EQUAL")
    end
end