# 완전탐색 풀이
import itertools
data = list(map(int, input().split()))
data.sort()
set(data)
c=itertools.combinations(data,1)
mylist=[]
for i in range(1,6):
c=itertools.combinations(data,i)
temp=list(c)
for j in range(0,len(temp)):
mylist.append(sum(temp[j]))
mylist =list(set(mylist))
mylist.sort()
num=1
idx=0
while True:
if mylist[idx] is not num:
break
num+=1
idx+=1
#greedy 풀이
data = list(map(int, input().split()))
data.sort()
target = 1
for i in range(len(data)):
print(data[i])
if target<data[i]:
break
target +=data[i]