let A = readLine()!
let B = readLine()!
if A.count > B.count {
    print("GREATER")
} else if A.count < B.count {
    print("LESS")
} else if A > B {
    print("GREATER")
} else if A < B {
    print("LESS")
} else {
    print("EQUAL")
}