'use strict'

function main(s) {

  s = s.split('\n').slice(0, -1);

  const a = s[0];
  const b = s[1];

  let ans = '';

  if (a.length > b.length) {
    ans = 'GREATER';
  } else if (a.length < b.length) {
    ans = 'LESS';
  } else {
    for (let i = 0; i < a.length; i++) {
      const na = Number(a.charAt(i));
      const nb = Number(b.charAt(i));
      if (na > nb) {
        ans = 'GREATER';
        break;
      } else if (na < nb) {
        ans = 'LESS';
        break;
      } else {
        continue;
      }
    }
  }

  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));
