#include <iostream>
using namespace std;

int main(){
	string a,b;
	
	cin >> a >> b;
	int al = a.size(),bl = b.size();
	
	if(al > bl) cout << "GREATER";
	else if(al < bl) cout << "LESS";
	else{
		if(a > b) cout << "GREATER";
		else if(a==b) cout << "EQUAL";
		else cout << "LESS";
	}
}