integer::N character(30),allocatable::A(:,:) character(30),parameter::nyanpass='nyanpass ' character(30),parameter::skip='- ' logical::renge integer::indx=0,i read *,N allocate(A(N,N)) read *,A do i=1,N renge = ALL(A(i,:).eq.nyanpass.or.A(i,:).eq.skip) if(renge.eqv..true.) then if(indx.ne.0) then exit else indx = i end if end if end do if (indx.ne.0) then print '(i0)',indx else print '(a)', "-1" end if end program