Anagram decomposition