Tell me the frequencies!
c=0
while 1:
try:
a=list(input())
if c!=0:
print()
c=1
dic={}
for i in a:
if ord(i) not in dic:
dic[ord(i)]=1
else:
dic[ord(i)]+=1
ans=sorted(dic.items(),key=lambda x:x[0],reverse=1)
ans=sorted(ans,key=lambda x:x[1])
for x,y in ans:
print('{} {}'.format(x,y))
except:
break