Function that prints the index of each letter in a word