Solving systems with substitution