• $n = 4$, and $m_ i, a_{ij}, w_ i, g_ i$ given by

$\left( \begin{matrix} m \\ 2m \\ 2m \\ m \end{matrix} \right), \quad \left( \begin{matrix} -4w & 2w & 0 & 0 \\ 2w & -2w & w & 0 \\ 0 & w & -2w & 2w \\ 0 & 0 & 2w & -4w \end{matrix} \right), \quad \left( \begin{matrix} 2w \\ w \\ w \\ 2w \end{matrix} \right), \quad \left( \begin{matrix} 0 \\ 0 \\ 0 \\ 0 \end{matrix} \right)$

with $w$ and $m$ arbitrary,

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).