from collections import Counter
a = input().split() #Thank you for your mail and your lectures
counter = Counter(a)
for word, cnt in counter.most_common():
print(word, cnt) #your 2
#Thank 1
#you 1
#for 1
#mail 1
#and 1
#lectures 1
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme