def fun284(num_list):
list = []
reslut = ''
max_num = max(num_list)
for num in num_list:
if len(str(max_num)) == len(str(num)):
list.append([str(num),0])
else:
list.append([str(num)+ str(num)[len(str(num))-1]*(len(str(max_num))-len(str(num))),len(str(max_num))-len(str(num))])
list.sort(reverse=True)
for num in list:
reslut += num[0][0:len(num[0])-num[1]]
return reslut
#num_list = [1, 20, 23, 4, 8]
#num_list = [4, 6, 65]
#num_list = [4,6,67]
#num_list = [262,242,29,282,2822]
#num_list = [650, 580, 66, 9, 661, 59]
#num_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
#num_list = [3577,9155,9352,7911,1622]
num_list = [25,5,12,97,3,8,79,73,38,88,98,29,84,74,16,2,67,65,41,44,88,75,51,87,95,90,45,40,7,53,5,30,77,5,56,58,41,51,62,88,33,69,81,78,18,63,82,90,21,6,12,92,67,6,81,83,14,6,76,85,79,96,41,44,20,89,59,58,83,58,73,1,41,41,24,55,61,49,10,42,5,1,98,30,91,9,34,5,84,43,73,4,22,11,21,14,1,62,77,41]
result = int(fun284(num_list))
print(result)