s=input() s= s.lower() words =str(s) counts ={} for word in words: counts[word] = counts.get(word,0)+1 print(counts)
n= int(input()) txt ='' for i in range(n): s=input() txt += s txt = txt +' ' txt = txt.lower() for ch in '!"#$%&()*+,-./:;<=>?@[\\]^_{|}~`0123456789': txt =txt.replace(ch,"") words = txt.split() counts ={} for word in words: counts[word] =counts.get(word,0)+1 items =list(counts.items()) items.sort() for i in range(len(items)): print("{} {}".format((items[i])[0],(items[i])[1]))