#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<iostream>
using namespace std;

string a;
string b;

int main(){
	cin >> a >> b;
	if(a > b) printf("GREATER\n");
	else if(a < b) printf("LESS\n");
	else printf("EQUAL\n");
}