#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;

int main()
{
	string a,b;
	cin>>a>>b;
	if(a > b) printf("GREATER\n");
	else if(a < b) printf("LESS\n");
	else printf("EQUAL\n");
}