Tony and Cleo are donating some of their books to a hospital. If Tony contributes half of his books and Cleo gives one third of hers, they will donate a total of 30 books. If tony gives two fifths of his books and Cleo contributes half of hers, they will donate a total of 31 books. How many books does each have?