import Foundation

let a = readLine()!
let b = readLine()!
var ans = ""
if a == b {
  ans = "EQUAL"
} else if a.count < b.count {
  ans = "LESS"
} else if a.count > b.count {
  ans = "GREATER"
} else {
  for (i, j) in zip(a, b) {
    if i > j {
      ans = "GREATER"
      break
    } else if i < j {
      ans = "LESS"
      break
    }
  }
}
print(ans)