A = tostring(io.read())
B = tostring(io.read())
if #A>#B then
    print("GREATER")
elseif #A<#B then
    print("LESS")    
elseif #A==#B then
    oh = true
    for i=1 , #A do
        if A:sub(i,i) > B:sub(i,i) then
            oh = false
            print("GREATER")
            break
        elseif A:sub(i,i) < B:sub(i,i) then
            oh = false
            print("LESS")
            break
        end
    end
    if oh then
        print("EQUAL")
    end
end