*l,=list(map(int,input().split()))

l.sort()

print((l[2]*10+l[1]+l[0]))
l=sorted(map(int,input().split()))

print((l[2]*10+sum(l[:2])))
(*l,) = list(map(int, input().split()))
l.sort()
print((l[2] * 10 + l[1] + l[0]))

l = sorted(map(int, input().split()))
print((l[2] * 10 + sum(l[:2])))

-(*l,) = list(map(int, input().split())) -l.sort() -print((l[2] * 10 + l[1] + l[0])) +l = sorted(map(int, input().split())) +print((l[2] * 10 + sum(l[:2])))