#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	string A;
	string B;
	int i,flag = 0;
	cin >> A >> B;
	if(A.length() > B.length())
		cout << "GREATER" << endl;
		else if(A.length() < B.length())
			cout << "LESS" << endl;
			else
			{
				for(i = 0;i < A.length(); i++)
				{
					if(A[i] > B[i])
					{
						flag = 1;
						break;
					}
						else if(A[i] < B[i])
						{
							flag = 2;
							break;
						}
				}
				if(flag == 0)
					cout << "EQUAL" << endl;
					else if(flag == 1)
						cout << "GREATER" << endl;
						else
							cout << "LESS" << endl;
			}
							return 0;
}