Anagram linearization