#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int main() {
	char a[1005], b[1005];
	while(~scanf("%s %s", a, b)) {
	int lena, lenb;
	lena = strlen(a);
	lenb = strlen(b);
	int flag = 0;
	if(lena < lenb)	printf("LESS\n");
	else if(lena > lenb) printf("GREATER\n");
	else {
		for(int i = 0; i < lena; i++) {
			if(a[i] > b[i]) {
				flag = 1;
				printf("GREATER\n");
				break;
			}
			else if(a[i] < b[i]) {
				flag = 1;
				printf("LESS\n");
				break;
			}
		}
		if(flag == 0) printf("EQUAL\n");
	}
	}
	return 0;
}

