#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
	int i;
	int len1,len2;
	char a[105];
	char b[105];
	scanf("%s",a);
	scanf("%s",b);
	len1 = strlen(a);
	len2 = strlen(b);
	if(len1 < len2)
	{
		printf("LESS\n");
	}
	if(len1 > len2)
	{
		printf("GREATER\n");
	}
	int vis = 1;
	if(len1 == len2)
	{
		for(i = 0 ; i < len1 ; i++)
		{
			if(a[i] < b[i])
			{
				vis = 0;
				printf("LESS\n");
				break;
			}
			if(a[i] > b[i])
			{
				vis = 0;
				printf("GREATER\n");
				break;
			}
		}
		if(vis == 1)
		{
			printf("EQUAL\n");
		}
	}
	return 0;
}