program sample
    implicit none
    character(100)::s,t
    integer(8) :: i,j,k,m,n
    integer(8)::a,b,c,d
    integer(8),allocatable::x(:),y(:)
  
    read(*,*) s
    read(*,*)t
    n=len_trim(s)
    m=len_trim(t)
    if(n>m)then
        write(*,*)'GREATER'
        stop
    elseif(n<m)then
        write(*,*)'LESS'
        stop
    endif

    do i=1,n
        if(ichar(s(i:i))>ichar(t(i:i)))then
            write(*,*)'GREATER'
            stop
        elseif(ichar(s(i:i))<ichar(t(i:i)))then
            write(*,*)'LESS'
            stop
        endif
    end do
    write(*,*)'EQUAL'
    stop
end program sample
  

