#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;
const int MaxN = 1e9;
char s1[MaxN];
char s2[MaxN];

int main() {
	while(~scanf("%s %s", s1, s2)) {
		int l1 = strlen(s1);
		int l2 = strlen(s2);
		bool flag = 0;
		if(l2 > l1) {
			flag = 1;
			puts("LESS");
		}
		else if(l1 > l2) {
			flag = 1;
			puts("GREATER");
		}
		else {
			for(int i = 0; i < l1; i++) {
				if(s1[i] > s2[i]) {
					flag = 1;
					puts("GREATER");
					break;
				}
				else if(s1[i] < s2[i]) {
					flag = 1;
					puts("LESS");
					break;
				}
				else continue;
			}
		}
		if(!flag) puts("EQUAL");
	}
	return 0;
}