function Main(input) {
  input = input.split("\n");
  var a = splitBigInt(input[0]);
  var b = splitBigInt(input[1]);
  result = "EQUAL";
  for(var i = 0, len = a.length; i < len; i++) {
    if(result !== "EQUAL") {
      break;
    }
    var aa = parseInt(a[i], 10);
    var bb = parseInt(b[i], 10);
    if(aa < bb) {
      result = "LESS";
    } else if(aa > bb) {
      result = "GREATER";
    } else {
      result = "EQUAL";
    }
  }
  console.log(result);
}
function normalize(str) {
  while(str.length <= 101) {
    if(str.length == 101) break;
    str = "0" + str;
  }
  return str;
}
function splitBigInt(str) {
  str = normalize(str);
  var ret = [];
  
  for(var i = 0; i < 11; i++) {
    ret.push(str.substring(0 + i * 10, 10 + i * 10));
  }
  return ret;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));