You will be given a group of words. You need to print all unique words in that group in descending order of their frequency, i.e the word repeated most number of times will come first. In case of two words having the same frequency, the word listed earlier in the group will be printed first.
First line contains N, the number of words.
Next line contains N space-separated words.
can you can a can as a canner can can a can