program SEQ

  character(80) :: LINE
  integer :: SeqNo

  seqNo = 101
  do
    read ( *, '(a)', end=99 ) line
    if ( line(1:5) == '' ) then
      write ( *, '(i4,1x,a)') seqNo, trim(line(6:))
      seqNo = seqNo + 1
    else
      write ( *, '(a)') trim(line)
    end if
  end do
99 continue
end program SEQ
