import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int cmp(string a, string b) {
    if (a.length == b.length) {
        if (a == b) return 0;
        return a < b ? -1 : 1;
    }
    else if (a.length < b.length) {
        return -1;
    }
    return 1;
}

void main() {
    auto a = read!string;
    auto b = read!string;

    auto c = cmp(a, b);
    if (c < 0) writeln("LESS");
    else if (c == 0) writeln("EQUAL");
    else writeln("GREATER");
}
