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

char a,b;

int main()
{
	scanf("%s",&a);
	scanf("%s",&b);
	if(a > b) printf("GREATER\n");
	else if(a == b) printf("EQUAL\n");
	else printf("LESS\n");
	return 0;
}