import sys

dict_char = {}

with open(sys.argv[1], 'r') as f:
	for line in f:
		for c in line:
			if c not in dict_char.keys():
				dict_char[c] = 1
			else:
				dict_char[c] += 1


l = sorted( dict_char.items(), key = lambda key_val : (key_val[1], key_val[0]) , reverse=True)
for items in l:
	print(str(items[0]) + '  '+str(items[1]))




#print(dict_char)




