	program check
	character line*590
	open(1,file='in.asc')
	open(2,file='out.asc')
	do i=1,144
	read(1,'(A)',err=100,end=100) line
	do k=1,32
	ip=index(line,'NA')
	if(ip.ne.0) then
	ip1=ip+1
	line(ip:ip1)='-9'
	endif
	enddo
        ip=index(line,'-777')
        if (ip.gt.0) then
        print*,line
        else
	write(2,'(A)') line
	endif
	enddo
100     continue
	end
	