	character*133 dis,err
	character*20 f1
	real a(16)
	if(iargc().lt.2)then
	  write(*,*)
	  write(*,*)' Usage: limfilt file n'
          write(*,*)'    ex. limfilt t359.all 8'
	  write(*,*)
	  stop
	endif
	call getarg(1,f1)
	call getarg(2,dis)
	read(dis(1:),*)k
	open(1,file=f1,status='old')
	read(1,'(a)')dis
	kk=lnblnk(dis)
	write(*,'(a)')dis(1:kk)
	n16=16-(133-kk)/6
	kk=133-(16-n16)*6
10	read(1,'(a)',end=100)dis
	read(1,'(a)')err
	read(err(38:),'(16f6.3)')a
	j=0
	do 20 i=1,n16
20	if(a(i).ne.0)j=j+1

	if(j.ge.k)then
	  write(*,'(a)')dis(1:kk)
	  write(*,'(a)')err(1:kk)
	endif
	goto 10
100	close(1)
	end
