A method of solving word problems