mt = list()
for i in range(10):
    mt.append(int(raw_input()))

mt = sorted(mt,reverse=True)
for i in range(3):
    print mt[i] mt = list() mt list() list for i in range(10):
    mt.append(int(raw_input())) i range(10) range 10 mt.append(int(raw_input())) mt.append mt append int(raw_input()) int raw_input() raw_input mt = sorted(mt,reverse=True) mt sorted(mt,reverse=True) sorted mt reverse=True reverse True for i in range(3):
    print mt[i] i range(3) range 3 print mt[i] mt i mt = sorted(mt,reverse=True) sorted(mt,reverse=True) mt mt = list() list() mt
mt = list()
for i in range(10):
    mt.append(int(raw_input()))

mt = sorted(mt,reverse=True)
for i in range(3):
    print mt[i]