#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<map>
#include<queue>
#include<iostream>
#include<algorithm>
#define m(a,b) memset(a,b,sizeof(a));
using namespace std;
const int inf = 1 << 30;
const int maxn = 1e5;
typedef long long LL;
int main(){
	char a[maxn+5],b[maxn+5];
	cin >> a >> b;
	if(strcmp(a,b)>0) cout << "GREATER" << endl;
	else if(strcmp(a,b) == 0) cout << "EQUAL" << endl;
	else cout << "LESS" << endl;
	return 0;
}