      program ratio 
      parameter(nf=5000)
************************************************************************
* This program calculates the ratio of two files. 
* From standard input it reads:
*      filename 1
*      filename 2
* the two files should have the format x y z, with equal length and x's
* on standard output  it produces x y1/y2 z1/z2    
************************************************************************
      real x(nf),y1(nf),y2(nf),z1(nf),z2(nf)
      integer i,mm
      character*40 fillow,filhig
      read(*,'(a40)') fillow
      read(*,'(a40)') filhig
      open(12,file=fillow)
      open(13,file=filhig)
      do 10 i=1,nf
       read(12,*,end=11) x(i),y1(i),z1(i)
10    continue
11    close(12)
      mm=i-1
      do 20 i=1,mm
       read(13,*,END=21) x(i),y2(i),z2(i)
20    continue
21    close(13)
      do 30 i=1,mm
       write(*,*) x(i),y1(i)/y2(i),z1(i)/z2(i)
 30    continue
      end       

      


