#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <algorithm>

using namespace std;

char s1[1000];
char s2[1000];

int main()
{
	cin >> s1 >> s2;
	int len1 = strlen(s1);
	int len2 = strlen(s2);
	if(len1 > len2) cout << "GREATER" << endl;
	else if(len1 < len2) cout << "LESS" << endl;
	else{
		for(int i = 0 ; i  < len1 ; i++){
			if(s1[i] > s2[i]){
				cout << "GREATER" << endl;
				return 0;
			}
			else if(s1[i],s2[i]){
				cout << "LESS" << endl;
				return 0;
			}
		 }
		cout << "EQUAL" << endl;
	}
	return 0;
}
