#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
char s[1005],t[1005];
int main()
{
	cin>>s;
	cin>>t;
	int n = strlen(s);
	int l = strlen(t);
	if(n > l) cout<<"GREATER"<<endl;
	else if(n < l) cout<<"LESS"<<endl;
	else {
		int flag = 0;
		for(int i = 0; i < n; i++){
			if(s[i] > t[i]) {
				flag = 1;
				break;
			}
			else if(s[i] < t[i]) {
				flag = 2;
				break;
			}
		}
		if(flag == 1) cout<<"GREATER"<<endl;
		else if(flag == 2) cout<<"LESS"<<endl;
		else if(flag == 0) cout<<"EQUAL"<<endl;
	}
}