Recently, loneknight is interesting in investigating the power of word. After several weeks of research, He recognize that there are some magic words in the world, if a word contains a magic word as its substring, it will have magic power. For example, if the word 'magic' is magic word, then the word 'magic', 'amagic', 'xxmagic', 'magiczz' are all power words.
In addition to this finding, he also find that the index of a powerword has a important impact on the power of word. The index of a power word define as follow: given the set of magic words, if we list all the powerword contain one or more magic word as substring in a list lexicographically from short length to long, the curring position of a word in the list is its index. So, if the magic words are 'magic' and 'hello', then word have index 1 is 'hello', the word have index 2 is 'magic', the word have index 3 is 'ahello' ... (only consider the lowercase words) .
Now, loneknight have find a way to calculate the the indices of the most powerful words, he want to find what the actually word is. Can you help him?