#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<queue>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<map>
#include<set>
using namespace std;
const int maxn = 1e3;
char A[maxn],B[maxn];
int main()
{
	while( scanf(" %s",A) != EOF ){
		scanf(" %s",B);
		int lenA = strlen(A);
		int lenB = strlen(B);
		int check = 0,flag = 0;
		if( lenA > lenB )
			printf("GREATER\n");
		else if( lenA < lenB )
			printf("LESS\n");
		else{
			for( int i = 0 ; i < lenA ; i++ ){
				if( A[i] > B[i] ){
					flag = 1;
					break;
				}
				else if( A[i] < B[i] ){
					flag = 2;
					break;
				}
				else
					check += 1;
			}
			if( flag == 1 )
				printf("GREATER\n");
			else if( flag == 2 )
				printf("LESS\n");
			else
				printf("EQUAL\n");
		}
		memset( A , ' ' , sizeof(A) );
		memset( B , ' ' , sizeof(B) );
	}
}