data=list(map(int, input().split()))
acount=0
bcount=0
for i in range(3):
if data[0]==data[i]:
acount+=1
for i in range(1,3):
if data[1]==data[i]:
bcount+=1
if acount>bcount:
if acount==3:
print(f"{acount} {data[0]}")
elif acount==2:
del data[0:1]
data.sort(reverse=True)
a=data[0]
b=data[1]
print(f"{acount} {a} {b}")
elif bcount>acount:
del data[1:2]
data.sort(reverse=True)
a=data[0]
b=data[1]
print(f"{bcount} {a} {b}")
else:
data.sort(reverse=True)
a=data[0]
b=data[1]
c=data[2]
print(f"1 {a} {b} {c}")