# budovani tagmisu



BEGIN {
	poc=0;
      }
{
 
 if (ARGIND==1)
  {
# matice
    x=substr($2,2);
    d=length($3);
    y=substr($3,1,d-1);
    p=$1;
    mat[x,y]=p;   
    rad[x]=x;
    slo[y]=y;
#   printf "%s %i %s\n",x,p,y;
  };

 if (ARGIND==2)
  {
   d=length($2);
   z=substr($2,2,d-2)
   p=$1;
   vek[z]=p;
   rad[x]=x;
   slo[y]=y;

#  printf "%s %i\n",z,p;
  }; 

}
END { 
   for ( x in rad )
     for (y in slo)
     {
       if (vek[x]==0 || vek[y]==0) printf "%s %s 0 \n",x,y ; else
#      if (mat[x,y]!=0)
       {
#       printf "%s %s %i\n", x,y,mat[x,y];
        printf "%s %s %f \n", x,y,log(1000000*mat[x,y]/(vek[x]*vek[y]))/log(2);
       }
     
     }
    }


