How to write a program for Almost Anagram
first line of input is the number of words(N) and following N lines are the words in that list.
the number of words r