The question:

A had 3 times as many books as B. A sold B 50 books; then B had twice as many as A. How many books had each then?

Both my dad and I put our heads together and we couldn't figure out the correct answer. Could someone help me write it out? Thank-you.