program prob1
    implicit none
    character(len=107)::a,b
    integer::la, lb, i
    read(*,*) a,b
    la = len_trim(a)
    lb = len_trim(b)
    if(la > lb) then
        write(*,'(a)') "GREATER"
        stop
    else if(la < lb) then
        write(*,'(a)') "LESS"
        stop
    else
        do i = 1, la
            if(a(i:i) > b(i:i)) then
                write(*,'(a)') 'GREATER'
                stop
            else if(a(i:i) < b(i:i)) then
                write(*,'(a)') "LESS"
                stop
            end if
        end do
    end if
    write(*,'(a)') 'EQUAL'
    stop
end program