C------------------------------------
C     FILE HANDLING
C------------------------------------
      REAL CA(3), CB(1000,3), DIST

      NATOM=100

      OPEN(Unit=10,File='dist3.inp',Status='Old')

      READ(10,*) (CA(J),J=1,3)

      DO I=1,NATOM
      READ(10,*) (CB(I,J),J=1,3)
      ENDDO

      CLOSE(Unit=10)

      OPEN(Unit=11,File='dist3.out', Status='New')

      DO I=1,NATOM
      DIST=SQRT((CA(1)-CB(I,1))**2 + (CA(2)
     1 -CB(I,2))**2 + (CA(3)-CB(I,3))**2 )
      WRITE(11,*) I, DIST
      ENDDO

      CLOSE(Unit=11)

      STOP
      END



