f a b = if a==b then"EQUAL"else if(length a)>(length b)then"GREATER"else if(length a)<(length b)then"LESS"else if(head a)>(head b)then"GREATER"else if(head a)<(head b)then"LESS"else f(tail a)(tail b)
main=getContents>>=putStrLn.(\[a,b] ->f a b).lines