txt=input("请输入一行字符串:")
dict={}
for i in txt:
dict[i]=dict.get(i,0)+1
ls=list(d.items())
ls.sort(key=lambda x :x[1],reverse=True)
for i in range(len(ls)):
m,n=ls[i]
print(m,n)
txt=input("请输入一行字符串:")
dict={}
for i in txt:
dict[i]=dict.get(i,0)+1
ls=list(d.items())
ls.sort(key=lambda x :x[1],reverse=True)
for i in range(len(ls)):
m,n=ls[i]
print(m,n)