	DIMENSION X(10),Y(10),XAXIS(800),YAXIS(800)
	CHARACTER *80 KFILE
	WRITE(5,*) 'ENTER (X)INPUT FILE NAME'
	READ(5,100) KFILE
	OPEN(UNIT=1,NAME=KFILE,TYPE='OLD')
	WRITE(5,*) 'ENTER (Y)INPUT FILE NAME'
	READ(5,100) KFILE
100	FORMAT (A)
	OPEN(UNIT=2,NAME=KFILE,TYPE='OLD')
	DO 230 J=1,4
	READ(1,100) KFILE
	READ(2,100) KFILE
230	CONTINUE
	DO 500 M=1,100
	READ(1,200,END=99) (X(I),I=1,8) 
	READ(2,200,END=99) (Y(I),I=1,8)
	DO 250 I=1,8
	IF(X(I).EQ.0) GO TO 250
	NPTS=NPTS+1
	XAXIS(NPTS)=X(I)
	YAXIS(NPTS)=Y(I)
200	FORMAT(8F10.2)
250	CONTINUE
500	CONTINUE

99	WRITE(5,*) 'ENTER OUTPUT FILENAME'
	READ(5,100) KFILE
	OPEN(UNIT=3,NAME=KFILE,TYPE='NEW')
	WRITE(3,278) NPTS
278	FORMAT(I4)
	DO 600  I=1,NPTS
	WRITE(3,350)XAXIS(I),YAXIS(I) 	
350	FORMAT(2G)
600	CONTINUE
	CLOSE(1)
	CLOSE(2)
	CONTINUE
	END
