object Main extends App {
	val a = scala.io.StdIn.readLine.toList
	val b = scala.io.StdIn.readLine.toList

	if(a.size > b.size) println("GREATER")
	else if(a.size < b.size) println("LESS")
	else{

		val ita = a.iterator
		val itb = b.iterator

		def rec(ta: Char, tb: Char): String = {
			if(ta > tb) "GREATER"
			else if(ta < tb) "LESS"
			else if(! ita.hasNext) "EQUAL"
			else rec(ita.next, itb.next)
		}

		println(rec(ita.next, itb.next))

	}



}