Solving systems of linear equations by substitution