#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<cstring>
#include<string>
using namespace std;
typedef long long LL;

char a[110], b[110];

int main()
{
	scanf("%s %s", a + 1, b + 1);
	int len1, len2, flag = -1;
	len1 = strlen(a+1);
	len2 = strlen(b+1);
	if(len1 < len2) cout << "LESS" << endl;
	else if(len1 > len2) cout << "GREATER" << endl;
	else{
		for(int i = 1;i <= len1;i++){
		if(a[i] > b[i]){
			flag = 1;
			break;
		}
		if(a[i] < b[i]){
			flag = 0;
			break;
		}
		}
		if(flag == 1) cout << "GREATER" << endl;
		if(flag == 0) cout << "LESS" << endl;
		if(flag ==-1) cout << "EQUAL" << endl;
	}
	return 0;
}