import std.stdio, std.string, std.array, std.conv, std.algorithm, std.typecons, std.range, std.container, std.math, std.algorithm.searching, std.functional,std.mathspecial;

void main(){
    auto a=readln;
    auto b=readln;
    if(a.length>b.length)writeln("GREATER");
    else if(a.length<b.length)writeln("LESS");
    else{
        foreach(ab;zip(a,b)){
            if(ab[0].to!int>ab[1].to!int){
writeln("GREATER");return;
            }else if(ab[0].to!int<ab[1].to!int){
writeln("LESS");return;
            }
        }
    writeln("EQUAL");
    }
}
