#include <bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main(){
	string a,b;cin>>a>>b;
	if(a.length()>b.length()) cout<<"GREATER";
	else if(a.length()<b.length()) cout<<"LESS";
	else if(a>b) cout<<"GREATER";
	else if(a<b) cout<<"LESS";
	else cout<<"EQUAL";
}
