""" day_01_01.py """

# usage: python3 day_01_01.py < input


import sys


tally = {}
with sys.stdin as infile:
    while (value := infile.readline()):
        value = int(value)
        tally[value] = tally.get(value, 0) + 1

data = list(sorted(tally.items(), key=lambda x: x[1], reverse=True))

print(data[0][0] * data[1][0] * data[2][0])
