// inputに入力データ全体が入る
function Main(input) {
  input = input.split("\n");
  var a = splitBigInt(input[0]);
  var b = splitBigInt(input[1]);
  result = "";
  for(var i = 0; i < 10; i++) {
    if(result !== "") {
      continue;
    }
    var aa = parseInt(a[i], 10);
    var bb = parseInt(b[i], 10);
    if(aa < bb) {
      result = "LESS";
    } else if(aa > bb) {
      result = "GRATER";
    } else if(i == 9 && aa == bb) {
      result = "EQUAL";
    }
  }
  console.log(result);
}
function normalize(str) {
  while(str.length <= 100) {
    if(str.length == 100) break;
    str = "0" + str;
  }
  return str;
}
function splitBigInt(str) {
  str = normalize(str);
  var ret = [];
  for(var i = 0; i < 100; i++) {
    ret.push(str.substring(0 + i * 10, 9 + i * 10));
  }
  return ret;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));