query words from HashSet to ArrayList
First version with multiple words and processing after a word has reached its last visited neighbour