Wendy and Mandy had the same number of books at first. Wendy gave her friend 17 books. Mandy bought another nine books during her birthday. The number of books Mandy has now becomes two more than three times the number of books Wendy has. How many books did each of them have at first?

If both started with x books, then

x+17+9 = 2+3(x-17)
Find x. I suspect a typo.