Recursively generating anagrams