#include<cstdio>
#include<cstring>
#include<iostream>
#include<cmath>
#include<map>
#include<queue>
#include<algorithm>
#include<cstdlib>
using namespace std;

int main(){
	char a[1005];
	char b[1005];
	int s;
	int n;
	int m;
	gets(a);
	gets(b);
	n=strlen(a);
	m=strlen(b);
	if(n>m) printf("GREATER\n");
	if(m>n) printf("LESS\n");
	if(m==n){
		s=strcmp(a,b);
		if(s>0) printf("GREATER\n");
		if(s<0) printf("LESS\n");
        if(s==0)  printf("EQUAL\n");
	}	
}