Solution (source code)

= Solution

The $i$th face through $v$ contains the two edge directions $e_j$ with $j\ne i$, so $a_i\cdot e_j=0$ for those $j$. The one-dimensional space with these two orthogonality conditions is spanned by $f_i$, hence $a_i=\lambda_i f_i$ for some nonzero real $\lambda_i$.