#include<cstdio>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	string a, b;
	cin >> a;
	cin >> b;
	int la = a.length();
	int lb = b.length();
	if(la > lb) printf("GREATER\n");
	else if(lb > la) printf("LESS\n");
	else{
		for(int i = 0; i < la; i++){
			if(a[i] > b[i]) {
				printf("GREATER\n");
				return 0;
			}
			else if(a[i] < b[i]){
				printf("LESS\n");
				return 0;
			}
			else if(a[i] == b[i] && i == la - 1){
				printf("EQUAL\n");
				return 0;
			}
		}
	}
	return 0;
}