#include <bits/stdc++.h>

using namespace std;

int main() {
  string a, b;
  cin >> a >> b;
  if (a.length() == b.length()) {
    puts(a < b ? "LESS" : (a == b) ? "EQUAL" : "GREATER");
  } else {
    puts(a.length() < b.length() ? "LESS" : "GREATER");
  }
  return 0;
}
