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

using namespace std;

char a[10005], b[10005];

int main()
{
	while(1) {
		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<max(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;
}