def nl(): return list(map(int, input().split()))

# print('Yes' if a else 'No')



arr = nl()

print((max(arr) * 9 + sum(arr)))
ary = list(map(int, input().split()))

ans = sum(ary) + 9 * max(ary)

print(ans)
def nl():
    return list(map(int, input().split()))


# print('Yes' if a else 'No')
arr = nl()
print((max(arr) * 9 + sum(arr)))

ary = list(map(int, input().split()))
ans = sum(ary) + 9 * max(ary)
print(ans)

-def nl(): -    return list(map(int, input().split())) - - -# print('Yes' if a else 'No') -arr = nl() -print((max(arr) * 9 + sum(arr))) +ary = list(map(int, input().split())) +ans = sum(ary) + 9 * max(ary) +print(ans)