Anagram flattening