Calculates all the combinations of a word