Anagram abstraction