put words in groups such that the total number of words in every group < 10,000