program main character(100)::SA,SB character(10000)::PA,PB character::XA,XB integer::len_pa,len_pb read *, SA, PA, XA read *, SB, PB, XB len_pa = len_trim(PA) len_pb = len_trim(PB) if (len_pa.gt.len_pb) then print '(a)', trim(SA) else if (len_pa.lt.len_pb) then print '(a)', trim(SB) else if (LGT(PA,PB)) then print '(a)', trim(SA) return else if (LLT(PA,PB)) then print '(a)', trim(SB) return else print '(a)',"-1" end if end if end program main