#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<queue>
#include<set>
using namespace std;
typedef long long ll;
const int inf=1<<29;
const ll Maxn=1e6;
const double pi=3.1415926536;

char a[Maxn],b[Maxn];
ll A,B;

int main(){
	cin>>a;
	cin>>b;
	A=strlen(a);
	B=strlen(b);
	if(A>B) printf("GREATER\n");
	if(A<B) printf("LESS\n");
	if(A==B){
		if(strcmp(a,b)>0) printf("GREATER\n");
		if(strcmp(a,b)<0) printf("LESS\n");
		if(strcmp(a,b)==0) printf("EQUAL\n");
	}
}