#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;

char a[1005], b[1005];

int main()
{
	int flag = 0;
	cin>> a;
	cin>> b;
	int n = strlen(a), m = strlen(b);
	if(n > m)
		printf("GREATER\n");
	else if(n < m)
		printf("LESS\n");
	else 
	{
		for(int i=0; i<min(n, m); i++)
		{
			if(a[i] > b[i]) {
				flag = 1;	break;
			}
			else if(a[i] < b[i]) {
				flag = -1;	break;
			}
			else {
				flag = 0;
			}
		}
		if(flag == 1)
			printf("GREATER\n");
		else if(flag == -1)
			printf("LESS\n");
		else
			printf("EQUAL\n");
	}
	return 0;
}