#https://zerojudge.tw/ShowProblem?problemid=i399
from collections import Counter
n = list(map(int,input().split(" ")))
counter = Counter(n)
most_common = counter.most_common(1)
print(most_common[0][1],end=" ")
for i in range(most_common[0][1]-1):
n.remove(most_common[0][0])
n.sort(reverse=True)
print(*n)