#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int main(){
	int a[105],b[105],len1,len2,vis,dis;
	char c[105],d[105];
	scanf("%s%s",c+1,d+1);
	len1=strlen(c+1);
	len2=strlen(d+1);
	for(int i=1;i<=len1;i++){
		a[i]=c[i]-'0';
		b[i]=d[i]-'0';
	}
	dis=0;
	if(len1>len2) printf("GREATER\n");
	else if(len1<len2) printf("LESS\n");
	else{
		for(int i=1;i<=len1;i++){
			if(a[i]<b[i]){
				vis=1;
				break;
			}
			else if(a[i]>b[i]){
				vis=2;
				break;
			}
			else{
				vis=3;
				dis++;
			}
		}
		if(vis==1) printf("LESS\n");
		else if(vis==2) printf("GREATER\n");
		else if(dis==len1) printf("EQUAL\n");
	}
}