program main implicit none character*200::sa,sb integer::a,b,space read *,sa,sb if(LEN_TRIM(sa).eq.1.and.LEN_TRIM(sb).eq.1) then read(sa,*),a read(sb,*),b if(a.eq.0.or.b.eq.0) then if(a.eq.0.and.b.eq.0) then print '(a)',"E" else print '(a)',"S" end if else if(a.eq.1.or.b.eq.1) then print '(a)',"S" else if(a.eq.2.and.b.eq.2) then print '(a)',"E" else print '(a)',"P" end if else if(LEN_TRIM(sa).eq.1) then write(sa,*),a if(a.le.1) then print '(a)',"S" else print '(a)',"P" end if else if(LEN_TRIM(sb).eq.1) then write(sb,*),b if(b.le.1) then print '(a)',"S" else print '(a)',"P" end if else print '(a)',"P" end if end if end program main