Anagram inversion