a = list(map(int,input().split()))

x = max(a)

a.remove(max(a))

print((10*x + a[0] +a[1]))
a,b,c = sorted(map(int,input().split()))

print((10*c+a+b))
a = list(map(int, input().split()))
x = max(a)
a.remove(max(a))
print((10 * x + a[0] + a[1]))

a, b, c = sorted(map(int, input().split()))
print((10 * c + a + b))

-a = list(map(int, input().split())) -x = max(a) -a.remove(max(a)) -print((10 * x + a[0] + a[1])) +a, b, c = sorted(map(int, input().split())) +print((10 * c + a + b))