L = [list(map(int,input().split()))]

K = int(eval(input()))

import copy



def peice_double(L):

    l = []

    for x in L:

        tmp = copy.copy(x)

        for i in range(3):

            tmp[i] = tmp[i] * 2

            l.append(copy.copy(tmp))

            tmp[i] = tmp[i] // 2

    return l

for i in range(K):

    L = peice_double(L)

ans = 0

for x in L:

    ans = max(ans, sum(x))

print(ans)
L = list(map(int,input().split()))

K = int(eval(input()))

m = max(L)

print((sum(L)-m + m* (2 ** K)))
L = [list(map(int, input().split()))]
K = int(eval(input()))
import copy


def peice_double(L):
    l = []
    for x in L:
        tmp = copy.copy(x)
        for i in range(3):
            tmp[i] = tmp[i] * 2
            l.append(copy.copy(tmp))
            tmp[i] = tmp[i] // 2
    return l


for i in range(K):
    L = peice_double(L)
ans = 0
for x in L:
    ans = max(ans, sum(x))
print(ans)

L = list(map(int, input().split()))
K = int(eval(input()))
m = max(L)
print((sum(L) - m + m * (2**K)))

-L = [list(map(int, input().split()))] +L = list(map(int, input().split())) -import copy - - -def peice_double(L): -    l = [] -    for x in L: -        tmp = copy.copy(x) -        for i in range(3): -            tmp[i] = tmp[i] * 2 -            l.append(copy.copy(tmp)) -            tmp[i] = tmp[i] // 2 -    return l - - -for i in range(K): -    L = peice_double(L) -ans = 0 -for x in L: -    ans = max(ans, sum(x)) -print(ans) +m = max(L) +print((sum(L) - m + m * (2**K)))