I have a simple doubt in this proof in Lang's Algebra book:

I can understand that there are some $g_1, g_2$ such that $f_1g_1+f_2g_2$ has leading coefficient 1 and degree $\le d-1$ but why by row operations we can suppose for some $i\neq 1,2$, $f_i=f_1g_1+f_2g_2$?
I almost understood the whole proof, I need help just in its last part.
Thanks in advance
Let $\deg(f_1g_1+f_2g_2)=e\le d-1$. (If you want to understand easier the argument below, try first the case $e=d-1$.)
If $\deg f_i<d-1$ for some $i\ge 3$, then add $x^{d-e-1}(f_1g_1+f_2g_2)$ to $f_i$. Otherwise, $\deg f_i=d-1$ for all $i\ge 3$ and denote by $a_i$ its leading coefficient. Then $f_i-a_ix^{d-e-1}(f_1g_1+f_2g_2)$ has degree $<d-1$, and so on.