#include<cstdio>
#include<cstring>

char a[1005];
char b[1005];
int cnt = 2;
int main(){
	scanf(" %s", a + 1);
	scanf(" %s", b + 1);
	int a1 = strlen(a + 1);
	int b1 = strlen(b + 1);
	if(a1 > b1)printf("GREATER\n");
	if(a1 < b1) printf("LESS\n");
	if(a1 == b1){
		for(int i = 1; i <= a1; i++){
			if(cnt == i){
				if(a[i] > b[i]) printf("GREATER\n");	
				if(a[i] < b[i]) printf("LESS\n");	
				if(a[i] == b[i]) cnt = i + 1;}
		}	
	}
	if(cnt == a1 + 1) printf("EQUAL\n");


}