Anagram logically