Sort word_data reversely for computation convenience.