I = [int(i) for i in input().split()]

I.sort(reverse=True)

a, b, c = list(map(str, I))

ans = int(a + b) + int(c)

print(ans)
a, b, c = sorted([i for i in input().split()], reverse=True)

print((int(a + b) + int(c)))
I = [int(i) for i in input().split()]
I.sort(reverse=True)
a, b, c = list(map(str, I))
ans = int(a + b) + int(c)
print(ans)

a, b, c = sorted([i for i in input().split()], reverse=True)
print((int(a + b) + int(c)))

-I = [int(i) for i in input().split()] -I.sort(reverse=True) -a, b, c = list(map(str, I)) -ans = int(a + b) + int(c) -print(ans) +a, b, c = sorted([i for i in input().split()], reverse=True) +print((int(a + b) + int(c)))