John went to three bookshops. He's spent 1/3 of his money and another $120 at the first bookshop. He continued to
spend 1/3 of his remaining money and another $120 at the second bookshop. At the third bookshop, he spent 1/3 of what
was left and another $120. In the end, he had nothing left. How much money did he have at first?
OK, so I would set all the money he has at first as X, our variable.
X - 1/3X - 120 = 2/3X - 120 is what he has after sentence 1
1/3(2/3X-120)-120 = 2/9X - 160 is what he has after sentence 2
1/3(2/9X - 160) -120 = 2/27X - 520/3 is what he has after sentence 3, but since by this time he doesn't have any money left, we can infer than
2/27X - 520/3 = 0, thus 2/27X = 520/3.
Find X to get the answer.