Solve a system of three variables